You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When plotting with WCSAxes, it is currently possible to change the unit of the axis using set_format_unit. However, this function does not support equivalencies, e.g. if I have an axis in nm, I cannot convert to Hz. This feature would allow you to pass an equivalency to set_format_unit such that you could apply an equivalency when formatting the units of an axis.
Describe the desired outcome
The desired outcome would be that an axis could be converted to a compatible unit under the selected equivalency, e.g. for a wavelength axis, I could change the axis to Hz under the spectral equivalency.
Additional context
As an example, here's a MWE that currently does not work because there is no way to pass an equivalency to set_format_unit,
I'll also note that the version of this problem I'm presenting here is actually the easy case, where you're converting from one non-angle axis to another. This problem is further complicated when talking about converting from an angle to a non-angle, e.g. applying an equivalency that allows to convert between m and degrees. This is because there are separate formatters implemented for axes with coord type "scalar" and coord type "longitude" or "latitude".
The text was updated successfully, but these errors were encountered:
wtbarnes
changed the title
Support for unit equivalencies when changing units on `WCSAxes
Support for unit equivalencies when changing units on WCSAxesMay 21, 2024
What is the problem this feature will solve?
When plotting with
WCSAxes
, it is currently possible to change the unit of the axis usingset_format_unit
. However, this function does not support equivalencies, e.g. if I have an axis in nm, I cannot convert to Hz. This feature would allow you to pass an equivalency toset_format_unit
such that you could apply an equivalency when formatting the units of an axis.Describe the desired outcome
The desired outcome would be that an axis could be converted to a compatible unit under the selected equivalency, e.g. for a wavelength axis, I could change the axis to Hz under the
spectral
equivalency.Additional context
As an example, here's a MWE that currently does not work because there is no way to pass an equivalency to
set_format_unit
,Ideally, one would be able to pass in an equivalency to
set_format_unit
as so,I'll also note that the version of this problem I'm presenting here is actually the easy case, where you're converting from one non-angle axis to another. This problem is further complicated when talking about converting from an angle to a non-angle, e.g. applying an equivalency that allows to convert between m and degrees. This is because there are separate formatters implemented for axes with coord type "scalar" and coord type "longitude" or "latitude".
The text was updated successfully, but these errors were encountered: