File tree 3 files changed +25
-2
lines changed
.continuous-integration/travis
3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 41
41
fi
42
42
43
43
# DOCUMENTATION DEPENDENCIES
44
- # build_sphinx needs sphinx and matplotlib (for plot_directive). Note that
45
- # this matplotlib will *not* work with py 3.x, but our sphinx build is
44
+ # build_sphinx needs sphinx as well as matplotlib and wcsaxes (for plot_directive).
45
+ # Note that this matplotlib will *not* work with py 3.x, but our sphinx build is
46
46
# currently 2.7, so that's fine
47
47
if [[ $SETUP_CMD == build_sphinx* ]]
48
48
then
49
49
$CONDA_INSTALL Sphinx=1.2.2 Pygments matplotlib
50
+ pip install wcsaxes
50
51
fi
51
52
52
53
# COVERAGE DEPENDENCIES
Original file line number Diff line number Diff line change @@ -337,6 +337,8 @@ packages:
337
337
and most affiliated packages include this as a submodule in the source
338
338
repository, so it does not need to be installed separately.)
339
339
340
+ - `WCSAxes <http://wcsaxes.readthedocs.org/en/latest/ >`_
341
+
340
342
.. note ::
341
343
342
344
Sphinx also requires a reasonably modern LaTeX installation to render
Original file line number Diff line number Diff line change @@ -235,6 +235,26 @@ ability to use the :class:`~astropy.wcs.WCS` to define projections in
235
235
Matplotlib. More information on installing and using WCSAxes can be found `here
236
236
<http://wcsaxes.readthedocs.org> `__.
237
237
238
+ .. plot ::
239
+ :include-source:
240
+
241
+ from matplotlib import rcParams, pyplot as plt
242
+ from astropy.io import fits
243
+ from astropy.wcs import WCS
244
+ from astropy.utils.data import download_file
245
+
246
+ fits_file = 'http://data.astropy.org/tutorials/FITS-images/HorseHead.fits'
247
+ image_file = download_file(fits_file, cache=True )
248
+ hdu = fits.open(image_file)[0]
249
+ wcs = WCS(hdu.header)
250
+
251
+ fig = plt.figure()
252
+ fig.add_subplot(111, projection=wcs)
253
+ plt.imshow(hdu.data, origin='lower', cmap='cubehelix')
254
+ plt.xlabel('RA')
255
+ plt.ylabel('Dec')
256
+ plt.show()
257
+
238
258
Other information
239
259
=================
240
260
You can’t perform that action at this time.
0 commit comments