From b80dc2832c7fe5dee9e0169ef9d1d682d1ef8afa Mon Sep 17 00:00:00 2001 From: DanRyanIrish Date: Wed, 28 Mar 2018 17:34:58 -0400 Subject: [PATCH] Set matplotlib backend for testing. --- .travis.yml | 4 ++-- ndcube/mixins/sequence_plotting.py | 4 ++-- ndcube/tests/test_sequence_plotting.py | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 67237df32..6d5f99b0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,8 +54,8 @@ matrix: include: - # Add a matploblib backend for generating plots in tests. - - env: MPLBACKEND='Agg' + # Add a matplotlib backend for generating plots in tests. + - env: MPLBACKEND='Agg' # Do a basic test. - os: linux diff --git a/ndcube/mixins/sequence_plotting.py b/ndcube/mixins/sequence_plotting.py index 33ce4aa7e..f304dd403 100644 --- a/ndcube/mixins/sequence_plotting.py +++ b/ndcube/mixins/sequence_plotting.py @@ -83,7 +83,7 @@ def plot(self, axes=None, plot_axis_indices=None, Returns ------- - ax: `matplotlib.axes.Axes`, `ndcube.mixins.sequence_plotting.ImageAnimatorNDCubeSequence` or `ndcube.mixins.sequence_plotting.ImageAnimatorCubeLikeNDCubeSequence` # noqa + ax: `matplotlib.axes.Axes`, `ndcube.mixins.sequence_plotting.ImageAnimatorNDCubeSequence` or `ndcube.mixins.sequence_plotting.ImageAnimatorCubeLikeNDCubeSequence` Axes or animation object depending on dimensionality of NDCubeSequence """ @@ -184,7 +184,7 @@ def plot_as_cube(self, axes=None, plot_axis_indices=None, Returns ------- - ax: ax: `matplotlib.axes.Axes`, `ndcube.mixins.sequence_plotting.ImageAnimatorNDCubeSequence` or `ndcube.mixins.sequence_plotting.ImageAnimatorCubeLikeNDCubeSequence` # noqa + ax: ax: `matplotlib.axes.Axes`, `ndcube.mixins.sequence_plotting.ImageAnimatorNDCubeSequence` or `ndcube.mixins.sequence_plotting.ImageAnimatorCubeLikeNDCubeSequence` Axes or animation object depending on dimensionality of NDCubeSequence """ diff --git a/ndcube/tests/test_sequence_plotting.py b/ndcube/tests/test_sequence_plotting.py index be0191cde..2c14aebdb 100644 --- a/ndcube/tests/test_sequence_plotting.py +++ b/ndcube/tests/test_sequence_plotting.py @@ -10,6 +10,9 @@ from ndcube.utils.wcs import WCS import ndcube.mixins.sequence_plotting +# Set matplotlib display for testing +matplotlib.use('Agg') + # sample data for tests # TODO: use a fixture reading from a test file. file TBD. data = np.array([[[1, 2, 3, 4], [2, 4, 5, 3], [0, -1, 2, 3]],