1

When I make matpoltlib images, I provide Astropy WCS object as the projection. This make makes grid lines as shown below.

enter image description here

However, when I make images for the entire visible horizon I get something like the below enter image description here

The problem in the above image is that, since the grid lines do not intersect the figure axis, the grid values do not get plotted. I was wondering if there is a way to show the grid values inside the figure (something like what gets done in a mollweide projection)

EDIT 1 The below is my code

import matplotlib.pyplot as plt
from astropy.io import fits
from astropy.wcs import WCS
hdu = fits.open("image.fits")
wcs = WCS(hdu[0].header,naxis=2)
plt.subplot(111,projection=wcs)
plt.imshow(hdu[0].data[0,0,:,:],origin="lower") 
plt.grid()
plt.show()
Mc Missile
  • 715
  • 11
  • 25
  • ax = fig.add_subplot(111, projection='mollweide') did you try this – nithin Nov 26 '19 at 09:27
  • It would help if you share your code – nithin Nov 26 '19 at 09:38
  • @nithin I have included my code. Also, I do not want a mollweide projection. I just want to retain the image in the same projection but have the grid values shown inside the image (like what happens in mollweide). – Mc Missile Nov 27 '19 at 02:05
  • can you upload the image which you use for image.fits , is it the first image? – nithin Nov 27 '19 at 13:35

0 Answers0