QuantumLearner commited on
Commit
eda446a
·
verified ·
1 Parent(s): 7f0cda0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -9
app.py CHANGED
@@ -151,8 +151,9 @@ if st.sidebar.button('Run Analysis'):
151
  bgcolor='rgba(255, 255, 255, 0.5)',
152
  bordercolor='rgba(0, 0, 0, 0)'
153
  ),
154
- height=600, # Adjust height to better fit 16:9 aspect ratio
155
- margin=dict(l=50, r=50, t=50, b=50)
 
156
  )
157
  elif column == ('CPIAUCSL', 'CPIAUCSL_PCT'):
158
  # Plot inflation and its percentage change on dual y-axes
@@ -173,10 +174,12 @@ if st.sidebar.button('Run Analysis'):
173
  bgcolor='rgba(255, 255, 255, 0.5)',
174
  bordercolor='rgba(0, 0, 0, 0)'
175
  ),
176
- height=600, # Adjust height to better fit 16:9 aspect ratio
177
- margin=dict(l=50, r=50, t=50, b=50)
 
178
  )
179
  elif column == ('GS10', 'DGS2', 'DGS1MO', 'TB3MS'):
 
180
  # Plot multiple Treasury rates in the same subplot
181
  for col in column:
182
  fig.add_trace(go.Scatter(x=combined_data.index, y=combined_data[col], mode='lines', name=col))
@@ -190,8 +193,9 @@ if st.sidebar.button('Run Analysis'):
190
  bgcolor='rgba(255, 255, 255, 0.5)',
191
  bordercolor='rgba(0, 0, 0, 0)'
192
  ),
193
- height=600, # Adjust height to better fit 16:9 aspect ratio
194
- margin=dict(l=50, r=50, t=50, b=50)
 
195
  )
196
  else:
197
  fig.add_trace(go.Scatter(x=combined_data.index, y=combined_data[column], mode='lines', name=key))
@@ -220,8 +224,9 @@ if st.sidebar.button('Run Analysis'):
220
  font_size=12,
221
  font_family="Rockwell"
222
  ),
223
- height=600, # Adjust height to better fit 16:9 aspect ratio
224
- margin=dict(l=50, r=50, t=50, b=50)
 
225
  )
226
  fig.update_xaxes(
227
  showgrid=True,
@@ -248,4 +253,5 @@ hide_streamlit_style = """
248
  footer {visibility: hidden;}
249
  </style>
250
  """
251
- st.markdown(hide_streamlit_style, unsafe_allow_html=True)
 
 
151
  bgcolor='rgba(255, 255, 255, 0.5)',
152
  bordercolor='rgba(0, 0, 0, 0)'
153
  ),
154
+ autosize=True,
155
+ margin=dict(l=50, r=50, t=50, b=50),
156
+ aspectratio=dict(x=16, y=9) # Maintain 16:9 aspect ratio
157
  )
158
  elif column == ('CPIAUCSL', 'CPIAUCSL_PCT'):
159
  # Plot inflation and its percentage change on dual y-axes
 
174
  bgcolor='rgba(255, 255, 255, 0.5)',
175
  bordercolor='rgba(0, 0, 0, 0)'
176
  ),
177
+ autosize=True,
178
+ margin=dict(l=50, r=50, t=50, b=50),
179
+ aspectratio=dict(x=16, y=9) # Maintain 16:9 aspect ratio
180
  )
181
  elif column == ('GS10', 'DGS2', 'DGS1MO', 'TB3MS'):
182
+
183
  # Plot multiple Treasury rates in the same subplot
184
  for col in column:
185
  fig.add_trace(go.Scatter(x=combined_data.index, y=combined_data[col], mode='lines', name=col))
 
193
  bgcolor='rgba(255, 255, 255, 0.5)',
194
  bordercolor='rgba(0, 0, 0, 0)'
195
  ),
196
+ autosize=True,
197
+ margin=dict(l=50, r=50, t=50, b=50),
198
+ aspectratio=dict(x=16, y=9) # Maintain 16:9 aspect ratio
199
  )
200
  else:
201
  fig.add_trace(go.Scatter(x=combined_data.index, y=combined_data[column], mode='lines', name=key))
 
224
  font_size=12,
225
  font_family="Rockwell"
226
  ),
227
+ autosize=True,
228
+ margin=dict(l=50, r=50, t=50, b=50),
229
+ aspectratio=dict(x=16, y=9) # Maintain 16:9 aspect ratio
230
  )
231
  fig.update_xaxes(
232
  showgrid=True,
 
253
  footer {visibility: hidden;}
254
  </style>
255
  """
256
+ st.markdown(hide_streamlit_style, unsafe_allow_html=True)
257
+