From 604ec652c13faa8a7ca7ba2a2f3fb8bdcb2a332d Mon Sep 17 00:00:00 2001 From: Michael Richman Date: Thu, 14 Apr 2022 22:07:43 -0400 Subject: [PATCH 1/2] recognize DARTS_CONFIGURE_MATPLOTLIB=0 * By default, darts still applies matplotlib configurations * If the environment variable DARTS_CONFIGURE_MATPLOTLIB=0 is set, then darts.u8plots_mplstyle is still defined but not applied --- darts/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/darts/__init__.py b/darts/__init__.py index 7330126fd8..479edaf262 100644 --- a/darts/__init__.py +++ b/darts/__init__.py @@ -3,6 +3,8 @@ ----- """ +import os + import matplotlib as mpl from matplotlib import cycler @@ -37,4 +39,5 @@ } -mpl.rcParams.update(u8plots_mplstyle) +if os.getenv("DARTS_CONFIGURE_MATPLOTLIB", "1") != "0": + mpl.rcParams.update(u8plots_mplstyle) From 02aaad53f9590af6ac59627fdd870ce29ad6631d Mon Sep 17 00:00:00 2001 From: Michael Richman Date: Thu, 21 Apr 2022 10:25:08 -0400 Subject: [PATCH 2/2] add entry to change log --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7871bc3b51..e74b80c760 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ Darts is still in an early development phase and we cannot always guarantee back ## [Unreleased](https://github.com/unit8co/darts/tree/master) [Full Changelog](https://github.com/unit8co/darts/compare/0.19.0...master) +### For users of the library: + +**Improved** +- Option to avoid global matplotlib configuration changes. + [#924](https://github.com/unit8co/darts/pull/924) by [Mike Richman](https://github.com/zgana). ## [0.19.0](https://github.com/unit8co/darts/tree/0.19.0) (2022-04-13) ### For users of the library: