astrofrog/wcsaxes — pull request #46 by lpsinger (2014-06-12 21:51:08+00:00)
Title: Compute tick angles by advancing a small amount in axes coordinates

This handles cases when a plot extends over a small number of pixels in the WCS projection, but a large distance or number of pixels in display coordinates. Addresses #45.

Here is a modified test script. The ticks are red and extra-long to make them stand out better.

#!/usr/bin/env python
from matplotlib import pyplot as plt
from wcsaxes import WCSAxes
import astropy.wcs

wcs = astropy.wcs.WCS()
wcs.wcs.ctype = ['RA---TAN', 'DEC--TAN']
wcs.wcs.crval = [90, 70]
wcs.wcs.cdelt = [16, 16]
wcs.wcs.crpix = [1, 1]
wcs.wcs.radesys = 'ICRS'
wcs.wcs.equinox = 2000.0
fig = plt.figure(figsize=(3, 3), dpi=72)
ax = WCSAxes(fig, [0.1, 0.1, 0.8, 0.8], wcs=wcs)
fig.add_axes(ax)
ax.set_xlim(1, -1)
ax.set_ylim(-1, 1)
ax.grid(color='gray', alpha=0.5)
ax.coords['ra'].set_ticks(color='red', size=20)
ax.coords['dec'].set_ticks(color='red', size=20)
fig.savefig('test.png', dpi=72)

![test](https://cloud.githubusercontent.com/assets/728407/3264181/83ad6656-f27b-11e3-9172-9411842a69d4.png)