-
Notifications
You must be signed in to change notification settings - Fork 153
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
Hide Matplotlib Axes checkbox #2128
base: main
Are you sure you want to change the base?
Conversation
For issue #1883 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2128 +/- ##
=======================================
Coverage ? 87.96%
=======================================
Files ? 246
Lines ? 22726
Branches ? 0
=======================================
Hits ? 19991
Misses ? 2735
Partials ? 0 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! I finally had a chance to take this for a spin, and it works well! However, two requests before we can go ahead and merge:
-
When axes are not shown, we should also remove the white padding around the image. If you take a look at the
init_mpl
function you'll see it callsfreeze_margins
. I think when you turn off the axes you might want to change that to freeze the margins to zero, and then change the frozen margins back to what they are currently if axes are turned back on. -
Currently if you load the L1448 cube, and show velocity on the x axis and say RA on the y axis, the
MatplotlibImageMixin._set_wcs
method is still getting called even when the axes are hidden. In principle we could avoid this call, or at least exit early inside that method if the axes are now shown - and then if the axes are turned on again, we could explicitly call_set_wcs
. This might make the slider even smoother for cases where the coordinate labels take a while to compute. -
Could you double check that in astropy.visualization.wcs, the ticks and so on are not being computed/drawn when the axes are hidden as is done here? I just want to make sure it's not that they are being computed but then not shown.
-
It looks like there are some real code style issues and potentially real test failures?
Thanks!
…xis when exporting to a python script
…ct results in a small border that causes the test to fail.
… to script. Added test of image script export with WCS
…e script export with hiden axes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rebase and remove the last commit since that CI issue should now be fixed?
This creates a checkbox that allows the user to hide 2D matplotlib axis. Allows to hide/show axis to included when exporting as script. Also adds test for hiding the axis and exporting.