QuantumLearner commited on
Commit
c0bf25d
·
verified ·
1 Parent(s): 6ff7d94

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -18
app.py CHANGED
@@ -127,34 +127,25 @@ if st.sidebar.button("Run Analysis"):
127
  # Add shaded areas for significant dates
128
  opacity_value = 0.1 # Adjust the opacity here (0.0 is fully transparent, 1.0 is fully opaque)
129
 
 
130
  for date in significant_dates_95:
131
- fig.add_shape(
132
- type="rect",
133
  x0=date,
134
- x1=date,
135
- y0=0,
136
- y1=1,
137
- xref="x",
138
- yref="paper",
139
  fillcolor="red",
140
- opacity=opacity_value,
141
  layer="below",
142
- line_width=0,
143
  )
144
 
145
  for date in significant_dates_05:
146
- fig.add_shape(
147
- type="rect",
148
  x0=date,
149
- x1=date,
150
- y0=0,
151
- y1=1,
152
- xref="x",
153
- yref="paper",
154
  fillcolor="blue",
155
- opacity=opacity_value,
156
  layer="below",
157
- line_width=0,
158
  )
159
 
160
  # Plot Hurst Exponent
 
127
  # Add shaded areas for significant dates
128
  opacity_value = 0.1 # Adjust the opacity here (0.0 is fully transparent, 1.0 is fully opaque)
129
 
130
+ # Use add_vrect for better control over shading
131
  for date in significant_dates_95:
132
+ fig.add_vrect(
 
133
  x0=date,
134
+ x1=date + pd.Timedelta(days=1), # Assuming you're shading a single day
 
 
 
 
135
  fillcolor="red",
136
+ opacity=0.1, # Adjust the opacity here
137
  layer="below",
138
+ line_width=0
139
  )
140
 
141
  for date in significant_dates_05:
142
+ fig.add_vrect(
 
143
  x0=date,
144
+ x1=date + pd.Timedelta(days=1),
 
 
 
 
145
  fillcolor="blue",
146
+ opacity=0.1, # Adjust the opacity here
147
  layer="below",
148
+ line_width=0
149
  )
150
 
151
  # Plot Hurst Exponent