From c8d499e81e5980c60b457e3190f0a71d0628f4a6 Mon Sep 17 00:00:00 2001 From: Lorenzo Stella Date: Fri, 15 Sep 2023 18:17:31 +0200 Subject: [PATCH] Fix Forecast plot method (#3006) Latest matplotlib update had broken it since we were using internal API --- requirements/requirements-docs.txt | 2 +- requirements/requirements-test.txt | 2 +- src/gluonts/model/forecast.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements/requirements-docs.txt b/requirements/requirements-docs.txt index 2de120c1f3..4e0fc592ae 100644 --- a/requirements/requirements-docs.txt +++ b/requirements/requirements-docs.txt @@ -15,4 +15,4 @@ click orjson black holidays~=0.9 -matplotlib +matplotlib~=3.6 diff --git a/requirements/requirements-test.txt b/requirements/requirements-test.txt index e520671b01..88205bcaf8 100644 --- a/requirements/requirements-test.txt +++ b/requirements/requirements-test.txt @@ -8,4 +8,4 @@ ujson orjson requests holidays~=0.9 -matplotlib +matplotlib~=3.6 diff --git a/src/gluonts/model/forecast.py b/src/gluonts/model/forecast.py index 0652c315a7..f41d001212 100644 --- a/src/gluonts/model/forecast.py +++ b/src/gluonts/model/forecast.py @@ -316,7 +316,7 @@ def plot( # If no color is provided, we use matplotlib's internal color cycle. # Note: This is an internal API and might change in the future. color = maybe.unwrap_or_else( - color, lambda: next(ax._get_lines.prop_cycler)["color"] + color, lambda: ax._get_lines.get_next_color() ) # Plot median forecast