diff --git a/.travis.yml b/.travis.yml index 67237df32..b0e33ae37 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 @@ -102,8 +102,13 @@ install: - git clone git://github.com/astropy/ci-helpers.git - source ci-helpers/travis/setup_conda.sh +before_script: + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" + - sleep 3 # give xvfb some time to start + script: - - $MAIN_CMD $SETUP_CMD + - $MAIN_CMD $SETUP_CMD after_success: - - if [[ $SETUP_CMD = *"cov"* ]]; then pip install codecov; codecov; fi + - if [[ $SETUP_CMD = *"cov"* ]]; then pip install codecov; codecov; fi 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..b85e5ca2b 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]],