update plotly and show only one legend for mean
Browse files- make_plot.py +3 -1
- requirements.txt +1 -1
make_plot.py
CHANGED
|
@@ -107,6 +107,8 @@ def plot_forecast(df: pd.DataFrame, forecasts: List[pd.DataFrame]):
|
|
| 107 |
mode="lines",
|
| 108 |
name="Mean Forecast",
|
| 109 |
line=dict(color="red", dash="dash"),
|
|
|
|
|
|
|
| 110 |
)
|
| 111 |
)
|
| 112 |
|
|
@@ -115,7 +117,7 @@ def plot_forecast(df: pd.DataFrame, forecasts: List[pd.DataFrame]):
|
|
| 115 |
title=f"{df.columns[0]} Forecast",
|
| 116 |
yaxis=dict(title=df.columns[0]),
|
| 117 |
showlegend=True,
|
| 118 |
-
legend=dict(x=0, y=1
|
| 119 |
hovermode="x", # Enable x-axis hover for better interactivity
|
| 120 |
)
|
| 121 |
|
|
|
|
| 107 |
mode="lines",
|
| 108 |
name="Mean Forecast",
|
| 109 |
line=dict(color="red", dash="dash"),
|
| 110 |
+
legendgroup="mean forecast",
|
| 111 |
+
showlegend=i == 0,
|
| 112 |
)
|
| 113 |
)
|
| 114 |
|
|
|
|
| 117 |
title=f"{df.columns[0]} Forecast",
|
| 118 |
yaxis=dict(title=df.columns[0]),
|
| 119 |
showlegend=True,
|
| 120 |
+
legend=dict(x=0, y=1),
|
| 121 |
hovermode="x", # Enable x-axis hover for better interactivity
|
| 122 |
)
|
| 123 |
|
requirements.txt
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
gluonts[torch,pro]
|
| 2 |
pandas
|
| 3 |
-
plotly
|
|
|
|
| 1 |
gluonts[torch,pro]
|
| 2 |
pandas
|
| 3 |
+
plotly>=5.15.0
|