How to make the ticks inward of the frame in WCSaxes?
See original GitHub issueHi, I was trying to display a fits file using WCSAxes. In my earlier version of matplotlib and WCSAxes, the ticks were appearing inward of the image frame. But, when I updated my astropy and matplotlib, the ticks are appearing outward of the frame. I tried direction=‘in’ keyword, but it is not working with WCSAxes. My other images created through other software have inward ticks, so I want consistency in all the images. My input code is as follows:
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
from astropy.io import fits
from astropy.wcs import WCS
from astropy import units as u
from astropy.visualization.wcsaxes import SphericalCircle
hdu = fits.open('newimage.fits')[0]
imdata = hdu.data
hdr = hdu.header
imdata[0,:,:].shape
wcs = WCS(hdr,relax=False)
w=wcs.celestial
clf()
fig = plt.figure(1)
ax = fig.add_subplot(111, projection=w, aspect='equal')
ax.tick_params(axis='both', which='both', direction='in')
ax.imshow(imdata[0,:,:], cmap='gray_r', vmin=4, vmax=8, norm=LogNorm(), origin='lower',alpha=1.0,aspect=1)
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
CoordinateHelper — Astropy v5.2
Helper class to control one of the coordinates in the WCSAxes . Parameters ... The frame of the WCSAxes . ... Get the...
Read more >CoordinateHelper — Astropy v3.2.dev994
Helper class to control one of the coordinates in the WCSAxes . ... display_minor_ticks (display_minor_ticks), Display minor ticks for this coordinate.
Read more >DS9 Reference Manual - University of Louisville Astronomy
For the current frame, if no regions are currently selected, clicking outside of a region will create a new region. See Regions for...
Read more >EITMap — SunPy 4.1.0 documentation
Reference point WCS axes in data units (i.e. ... instance created from the coordinate information for this Map, or None if the frame...
Read more >Always display entire tick labels on wcs axes - Stack Overflow
As another has said, this behaviour is expected and built in to Astropy via the TickLabels class function simplify_labels (see Astropy ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@astrosumit @rlpitts - just FYI you will be able to use
tick_params
in Astropy v3.1 once released (very shortly)Ok, great!
We should keep this open as we should add this to the docs and also make
tick_params
work correctly (currently it has no effect)