Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoalign plotting of maps is off by half a pixel #6794

Closed
ayshih opened this issue Feb 24, 2023 · 3 comments
Closed

Autoalign plotting of maps is off by half a pixel #6794

ayshih opened this issue Feb 24, 2023 · 3 comments
Labels
Bug Probably a bug Effort Low Requires a small time investment Good First Issue The best issues for new people to tackle! map Affects the map submodule Package Novice Requires little knowledge of the internal structure of SunPy Priority Medium Non-urgent action required

Comments

@ayshih
Copy link
Member

ayshih commented Feb 24, 2023

If you don't supply the pixel edges explicitly to pcolormesh(), it treats integer pixels as pixel edges, but we need integer pixels as pixel centers. We just need to supply pixel edges in this call:

ret = axes.pcolormesh(data, **imshow_args)

@ayshih ayshih added Bug Probably a bug map Affects the map submodule Priority Medium Non-urgent action required Effort Low Requires a small time investment Good First Issue The best issues for new people to tackle! labels Feb 24, 2023
@ayshih
Copy link
Member Author

ayshih commented Feb 24, 2023

The correct call should be:

ret = axes.pcolormesh(np.arange(data.shape[1] + 1) - 0.5,
                      np.arange(data.shape[0] + 1) - 0.5,
                      data, **imshow_args)

Also, a figure test needs to be updated/enhanced.

@ayshih ayshih added the Package Novice Requires little knowledge of the internal structure of SunPy label Feb 24, 2023
@Mihan786Chistie
Copy link
Contributor

#6796 [FIX] Autoalign plotting of maps is off by half a pixel

@ayshih
Copy link
Member Author

ayshih commented Feb 28, 2023

Fixed by #6796

Incidentally, I put this figure in that PR's discussion to show the bug:
221392011-fb938cba-de69-44e6-a0ab-3b9237df3bd2

@ayshih ayshih closed this as completed Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Probably a bug Effort Low Requires a small time investment Good First Issue The best issues for new people to tackle! map Affects the map submodule Package Novice Requires little knowledge of the internal structure of SunPy Priority Medium Non-urgent action required
Projects
None yet
Development

No branches or pull requests

2 participants