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

Add public API for WCSAxes to retrieve the tick locations and labels on each axis #16464

Open
astrofrog opened this issue May 16, 2024 · 5 comments
Labels
API change PRs and issues that change an existing API, possibly requiring a deprecation period Feature Request needs-discussion visualization.wcsaxes

Comments

@astrofrog
Copy link
Member

I am interested in being able to plot world coordinates in non-Matplotlib viewers, for example in bqplot. However, I would prefer to not have to re-implement all of WCSAxes in bqplot, and an alternative would be to internally store a WCSAxes instance and set limits on it, then query it for tick locations and labels. However, I don't think we have a proper way at the moment to get this - and:

ax.xaxis.get_ticklocs()
ax.yaxis.get_ticklabels()

is not correct because it is what the ticks would have been in the absence of WCSAxes. We might want to consider having e.g. CoordinateHelper.get_ticks() and CoordinateHelper.get_ticklabels() for this.

@astrofrog
Copy link
Member Author

It might be an option to also consider splitting out the 'core' WCSAxes algorithms for determining tick locations, labels, and gridlines so that they can be used in a frontend-agnostic way, which would make the code more future-proof and broadly useful.

@pllim pllim added API change PRs and issues that change an existing API, possibly requiring a deprecation period Feature Request labels May 16, 2024
@pllim
Copy link
Member

pllim commented May 16, 2024

Hmm, do we need APE for this? After all, you did an APE for wcsapi.

@pllim
Copy link
Member

pllim commented May 16, 2024

Also... Does this overlap with the "unified API" philosophy going on over at Astrowidgets, @mwcraig and @eteq ?

https://github.com/astropy/astrowidgets

@astrofrog
Copy link
Member Author

astrofrog commented May 16, 2024

Regarding an APE, I think I first need to prototype things to see how feasible this is in the first place in terms of splitting out the core stuff

If we do just provide a couple of methods on the current WCSAxes to get ticks and tick locations then those would naturally live on CoordinatesHelper.get_ticks and CoordinateHelper.get_ticklabels since we already have setters there.

@neutrinoceros
Copy link
Contributor

This looks related to other existing issues: #14047 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change PRs and issues that change an existing API, possibly requiring a deprecation period Feature Request needs-discussion visualization.wcsaxes
Projects
None yet
Development

No branches or pull requests

3 participants