Skip to content

Commit

Permalink
boost supported mpl version again
Browse files Browse the repository at this point in the history
  • Loading branch information
keflavich committed Nov 30, 2018
1 parent 9fed601 commit 24b6d81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down
4 changes: 3 additions & 1 deletion spectral_cube/tests/test_visualization.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)
Expand Down

0 comments on commit 24b6d81

Please sign in to comment.