From f51cc7a719a5d1391fb8e827f97b32646dccde9b Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Thu, 29 Nov 2018 18:08:05 -0700 Subject: [PATCH] boost supported mpl version again --- docs/visualization.rst | 2 +- spectral_cube/tests/test_visualization.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/visualization.rst b/docs/visualization.rst index 95559c0e5..6cdb45e4d 100644 --- a/docs/visualization.rst +++ b/docs/visualization.rst @@ -34,7 +34,7 @@ to plot an image slice. .. warning:: There are known incompatibilities with the above plotting approach: - matplotlib versions ``<2`` will crash, and you will have to clear the plot + matplotlib versions ``<2.1`` will crash, and you will have to clear the plot window to reset it. diff --git a/spectral_cube/tests/test_visualization.py b/spectral_cube/tests/test_visualization.py index 479b8ec8f..c406e27dc 100644 --- a/spectral_cube/tests/test_visualization.py +++ b/spectral_cube/tests/test_visualization.py @@ -1,6 +1,7 @@ from __future__ import print_function, absolute_import, division import pytest +from distutils.version import StrictVersion from .test_spectral_cube import cube_and_raw @@ -22,8 +23,9 @@ def test_proj_imshow(): plt = pytest.importorskip('matplotlib.pyplot') cube, data = cube_and_raw('vda_Jybeam_lower.fits') mom0 = cube.moment0() - if int(plt.matplotlib.__version__[0]) < 2: + if StrictVersion(plt.matplotlib.__version__) < StrictVersion('2.1'): # imshow is now only compatible with more recent versions of matplotlib + # (apparently 2.0.2 was still incompatible) plt.imshow(mom0.value) else: plt.imshow(mom0)