Skip to content

Commit

Permalink
Set matplotlib backend for Travis.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRyanIrish committed Mar 28, 2018
1 parent fdc9c57 commit 775c784
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ matrix:

include:

# Add a matplotlib backend for generating plots in tests.
- env: MPLBACKEND='Agg'

# Do a basic test.
- os: linux
stage: Initial tests
Expand Down Expand Up @@ -99,6 +102,11 @@ 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

Expand Down
2 changes: 1 addition & 1 deletion ndcube/mixins/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def _plot_3D_cube(self, plot_axis_indices=None, axes_units=None,
if plot_axis_indices is None:
plot_axis_indices = [-1, -2]
if axes_units is None:
axes_units = [None, None]
axes_units = [None, None]
i = ImageAnimatorWCS(self.data, wcs=self.wcs, image_axes=plot_axis_indices,
unit_x_axis=axes_units[0], unit_y_axis=axes_units[1],
axis_ranges=axes_coordinates, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion ndcube/tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_cube_plot_1D(test_input, test_kwargs, expected_values):
output_ylim = output.axes.get_ylim()
assert output_ylim[0] <= expected_ylim[0]
assert output_ylim[1] >= expected_ylim[1]


@pytest.mark.parametrize("test_input, test_kwargs, expected_values", [
(cube[0], {},
Expand Down

0 comments on commit 775c784

Please sign in to comment.