ConniKLu commited on
Commit
a688fb8
·
verified ·
1 Parent(s): 727307d

Upload app.py

Browse files

reset fig_price plot to unscaled

Files changed (1) hide show
  1. app.py +10 -14
app.py CHANGED
@@ -1012,21 +1012,17 @@ def plot_electricity_prices(m, dt, col, df, df_residual_load_duration):
1012
  with col:
1013
  st.plotly_chart(fig_duration)
1014
 
1015
- if st.session_state.level == "undergraduate":
1016
  # Line plot for electricity prices
1017
- fig_price = px.line(df_price, y='dual', x='t',
1018
- title=df.loc['plot_label_electricity_prices', st.session_state.lang],
1019
- range_y = [0, 300],
1020
- labels={'dual': '', 't': ''}
1021
- )
1022
- else:
1023
- # Line plot for electricity prices
1024
- fig_price = px.line(df_price, y='dual', x='t',
1025
- title=df.loc['plot_label_electricity_prices', st.session_state.lang],
1026
- # range_y = [0, 250],
1027
- labels={'dual': '', 't': ''}
1028
- )
1029
-
1030
  with col:
1031
  st.plotly_chart(fig_price)
1032
 
 
1012
  with col:
1013
  st.plotly_chart(fig_duration)
1014
 
 
1015
  # Line plot for electricity prices
1016
+ fig_price = px.line(df_price, y='dual', x='t',
1017
+ title=df.loc['plot_label_electricity_prices', st.session_state.lang],
1018
+ # range_y = [0, 250],
1019
+ labels={'dual': '', 't': ''}
1020
+ )
1021
+
1022
+ if st.session_state.level == "undergraduate":
1023
+ fig_price.update_yaxes(range=[0, 300], autorange=True) # Set initial view, autoscale remains available
1024
+
1025
+
 
 
 
1026
  with col:
1027
  st.plotly_chart(fig_price)
1028