From cbf38b1c199a79b45c5bafdb310374c9e0aa87e9 Mon Sep 17 00:00:00 2001 From: Ruth Comer Date: Tue, 15 Sep 2020 10:30:57 +0100 Subject: [PATCH 1/2] image tests: set agg after rcdefaults --- lib/iris/tests/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iris/tests/__init__.py b/lib/iris/tests/__init__.py index b5b80a97ef..19d5771648 100644 --- a/lib/iris/tests/__init__.py +++ b/lib/iris/tests/__init__.py @@ -59,8 +59,8 @@ try: import matplotlib - matplotlib.use("agg") matplotlib.rcdefaults() + matplotlib.use("agg") # Standardise the figure size across matplotlib versions. # This permits matplotlib png image comparison. matplotlib.rcParams["figure.figsize"] = [8.0, 6.0] From e32a84a70d1f45424e44889860770050b457aa08 Mon Sep 17 00:00:00 2001 From: Ruth Comer Date: Wed, 16 Sep 2020 08:43:46 +0100 Subject: [PATCH 2/2] add comments --- lib/iris/tests/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/iris/tests/__init__.py b/lib/iris/tests/__init__.py index 19d5771648..a603dec849 100644 --- a/lib/iris/tests/__init__.py +++ b/lib/iris/tests/__init__.py @@ -59,7 +59,9 @@ try: import matplotlib + # Override any user settings e.g. from matplotlibrc file. matplotlib.rcdefaults() + # Set backend *after* rcdefaults, as we don't want that overridden (#3846). matplotlib.use("agg") # Standardise the figure size across matplotlib versions. # This permits matplotlib png image comparison.