From 1c57f78c6d7a6513503d041bf25460f397992cb8 Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Sun, 3 Nov 2024 07:07:44 -0500 Subject: [PATCH 1/2] [FIX] tight_layout does not return anything --- neuralprophet/plot_model_parameters_matplotlib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neuralprophet/plot_model_parameters_matplotlib.py b/neuralprophet/plot_model_parameters_matplotlib.py index 097b3f3bc..292a7d081 100644 --- a/neuralprophet/plot_model_parameters_matplotlib.py +++ b/neuralprophet/plot_model_parameters_matplotlib.py @@ -137,7 +137,7 @@ def plot_parameters( multiplicative_axes.append(ax) weights = multiplicative_events plot_scalar_weights(weights=weights, plot_name=comp["plot_name"], focus=forecast_in_focus, ax=ax) - fig = fig.tight_layout() + fig.tight_layout() # Reset multiplicative axes labels after tight_layout adjustment for ax in multiplicative_axes: ax = set_y_as_percent(ax) From 996a48cff56eb0e22cefa60cdd5fc714a64fe508 Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Sun, 3 Nov 2024 08:03:00 -0500 Subject: [PATCH 2/2] fixup! --- neuralprophet/plot_forecast_matplotlib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neuralprophet/plot_forecast_matplotlib.py b/neuralprophet/plot_forecast_matplotlib.py index 846882880..ba90dc2f2 100644 --- a/neuralprophet/plot_forecast_matplotlib.py +++ b/neuralprophet/plot_forecast_matplotlib.py @@ -150,7 +150,7 @@ def plot( log.warning("Legend is available only for the ten first handles") else: ax.legend(handles, labels) - fig = fig.tight_layout() + fig.tight_layout() return fig @@ -239,7 +239,7 @@ def plot_components( elif "auto-regression" in name or "lagged regressor" in name: plot_multiforecast_component(fcst=fcst, ax=ax, **comp) - fig = fig.tight_layout() + fig.tight_layout() # Reset multiplicative axes labels after tight_layout adjustment for ax in multiplicative_axes: ax = set_y_as_percent(ax)