Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • kis_tools kis_tools
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 33
    • Issues 33
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sdc
  • kis_toolskis_tools
  • Issues
  • #294

Closed
Open
Created Nov 19, 2021 by Carl Schaffer@schafferOwner

Labels Vanish on IFU Map

Excerpt from sunpy matrix:

cschaffer

Hi all,

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[0] lat = ax.coords[1] # 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')

fig.savefig(...)

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

Edited Nov 19, 2021 by Carl Schaffer
Assignee
Assign to
Time tracking