-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fixes and Improvements to WCSAxes #9392
Conversation
de051a6
to
9799c4e
Compare
48192ff
to
4aacd74
Compare
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.
So does changing back to including all coordinates in ax.coords not break any existing tests?!
Otherwise just a few comments below, but overall I'm 👍 on this
337bece
to
3f5d9f7
Compare
Given the addition of the auto spine selection for 1D plots, I have made a change here which by default plots the physical type (and for scalar axes unit) as an axis label. This primarily so that it is easy to identify which spatial axis is which, but is also obviously more generally useful. This is a reasonably large change to the default behaviour, so I would be happy to add it only to the 1D plots if people think that's a good idea. @astrofrog @larrybradley |
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.
This all looks great (just a couple of comments below). Regarding the auto-labelling, I think this would be a good improvement to make. I know it would 'break' some existing plots where people don't want axis labels, but I'm thinking that's a pretty narrow use case as probably the majority of people will be using it with labels and won't see the difference?
However I think it's very important we document this well - both in the wcsaxes docs and in the what's new, so could you add both of these to this PR?
@larrybradley - do you agree about enabling the auto-labelling?
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.
I think the auto labeling is fine. For those who may not want axis labels, can we add an simple example/docs showing how to turn off the automatic labels?
New reference images are in astropy/astropy-data#76 also I wrote a script to generate them: astropy/astropy-tools#141 I will add a section to the narrative docs about disabling autolabel |
Small doc section added, let me know if you think it should be expanded. |
@Cadair - please update to use the new images, I've just merged your PR in astropy-data. |
According to @astrofrog in chat yesterday I put them in the wrong dir. I will issue a new data PR to move them. |
… correlated with which world axes
If we had a split coupled SLLWCS it broke
…t WCS In addition to this, the generation of the coord_map is handled correctly if a SlicedLowLevelWCS object and the slices argument are specified, where previously this would cause errors because of incorrect mapping between WCSAxes sliced WCS and the input WCS.
This means that for 1D plots the world axis which has the highest derivative is plotted on the bottom axes by default.
fe04e38
to
06f4e3c
Compare
slumps back into a chair I think this is now ready for final review. |
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.
Looks good overall, thanks! A few small things/issues related to the reference images:
- the reference image for
test_changed_axis_units
andtest_minor_ticks
looks wrong - the label for dec is on the wrong side - the
test_noncelestial_angular
reference image has confusing labels - both are the same - Is there a y label missing for
test_direct_init
or is it just out of the figure bounds? Maybe you can just turn off auto-labelling for that one too? - I wonder if we should turn off the auto-labelling for elliptical frames, the
test_elliptical_frame
example shows that it's maybe not ideal? - can you edit the
test_axisbelow
test to turn off autolabelling to limit a bit how many reference images are changed? (that one is a particularly prolific test) - there are reference images added for
test_axes_off
that are empty - for
test_tick_params
the unit bracket is empty so maybe not worth showing that bracket when unit is empty? also maybe disable auto-labelling for that test since it's really about the ticks - for test_update_clip_path_change_wcs
and
test_update_clip_path_rectangular`` same comment, unit is empty but actually maybe just turn off auto-labelling - for
test_update_clip_path_nonrectangular
keep the auto-labelling but this one can be the test for when the unit is empty?
I have updated the data PR, although i haven't modified the figure for #9411 |
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.
This looks good to me, so approving - however I will deal with merging the PR for the reference images tomorrow, which is needed for the CI to pass here. I'll do it over the weekend to avoid disrupting other PRs.
Thanks everyone!! |
This PR is a collection of WCSAxes related fixes, primarily focusing on APE 14 and 1D plotting.
It does the following things:
WCSAxes
ifslices
is passed andSlicedLowLevelWCS
is the wcs object. (Cadair@f7cc7b8#commitcomment-35522807)get_format_unit
method toCoordianateHelper
SlicedLowLevelWCS
if the slice is too long.