0

I'm plotting a .fits image using the next code

signal_filt = fits.open('signal_filt.fits')[0]
wcs = WCS(signal_filt.header)
fig = plt.figure()
ax = fig.add_axes([0.1,0.1,0.8,0.8], projection=wcs)
lqs = ax.imshow(signal_filt.data, vmin = -1,  vmax = 4, cmap = 'hot',origin = 'lower')
ax.imshow(signal_filt.data[y1:y2,x1:x2]*1000, vmin = -1,  vmax = 4, cmap = 'hot', origin = 'lower')
cb = plt.colorbar(lqs)
cb.set_label('Flux (mJy/beam)')

but I want to set the axes as follow: in the coordinate positions (wcs, centered in a specific star) hh:mm:ss and dd:mm:ss I want to set a zero, since there to left side I want to set negative values, while to the right side I want to set positive values, and in the same way upward and downward directions. Like this example, the zero coordinates is settled in a specific place, and axes shows "deltas"

Can anyone can help me?

Ben Hare
  • 4,365
  • 5
  • 27
  • 44
  • 1
    I might be missing something, but why not use just use [APLpy](https://aplpy.github.io/) for plotting FITS files? – Vlas Sokolov Feb 24 '17 at 19:51
  • perhaps see http://stackoverflow.com/questions/6999621/how-to-use-extent-in-matplotlib-pyplot-imshow. Or manually change the tick values. @VlasSokolov aplpy unfortunately does not (yet) implement offset coordinates: https://github.com/aplpy/aplpy/issues/31 – keflavich Feb 24 '17 at 22:30

1 Answers1

1

maybe using :

ax.set_xlim([xmin,xmax])
ax.set_ylim([ymin,ymax])

or

x1,x2,y1,y2 = plt.axis()
plt.axis((x1,x2,y1,y2))
Dadep
  • 2,796
  • 5
  • 27
  • 40