Labels Vanish on IFU Map
Excerpt from sunpy matrix:
I'm preparing data from one of our instruments for release to the public. This includes reformatting file format and FITS headers as well as generating preview images for the website.
I've encountered a problem with plotting sunpy maps: I read a file using sunpy.map.Map and simply do a .plot() on the resulting object. My issue is that sometimes the map will contain the auto-generated labels for the x and y axis and sometimes not resulting in inconsistent plots (I'm stitching the individual images into a GIF afterwards, so I need consistency). Of course I could just fix or omit the labels manually, but I suspect there's something wrong with the WCS of the files as mentioned in https://github.com/sunpy/sunpy/issues/2654 but I'm at a loss on how to debug/validate my WCS keywords.
I've collected a set of sample files and plots here happy for any help! Cadair Hey cschaffer that looks like fun
😆The fact you have ticks and no labels is interesting. I can't promise I will be able to look tomorrow, but I will have a poke sometime. dstansby It's because the rotation matrix of your images is almost 90 degrees, but by default sunpy tries to label longitude on the x-axis and latitude on the y-axis Doing something like this gives nice labels, with longitude on the y-axis and latitude on the x-axis:
12345678910111213141516fig = plt.figure() ax = fig.add_subplot(111, projection=m) m.plot(axes=ax)
lon = ax.coords lat = ax.coords # Put longitude ticks on left side lon.set_ticks_position('l') lon.set_ticklabel_position('l') lon.set_axislabel_position('l') # Put latitude ticks on bottom side lat.set_ticks_position('b') lat.set_ticklabel_position('b') lat.set_axislabel_position('b')
Perhaps a nice action to take on the sunpy side would be automatically doing this labelling 'flip' when the rotation of the map is > 45 degrees