question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to make the ticks inward of the frame in WCSaxes?

See original GitHub issue

Hi, 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:closed
  • Created 6 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
astrofrogcommented, Oct 25, 2018

@astrosumit @rlpitts - just FYI you will be able to use tick_params in Astropy v3.1 once released (very shortly)

0reactions
astrofrogcommented, Nov 29, 2017

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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found