astrofrog / wcsaxes

wcsaxes has been merged into astropy!
http://docs.astropy.org/en/stable/visualization/wcsaxes/index.html
22 stars 21 forks source link

Use the matplotlib units support to deal with conversions in and out of degrees #175

Open Cadair opened 9 years ago

Cadair commented 9 years ago

It's rather annoying to have to manually convert everything into degrees when plotting on top on an image in arcseconds. It would be cool if we could make mpl unit aware for stuff like this.

astrofrog commented 9 years ago

See also https://github.com/astropy/astropy/issues/3980

Need to check if we can make use of this

Cadair commented 9 years ago

@astrofrog That's what I was thinking of

astrofrog commented 9 years ago

Note from @mdboom

... you can look to the transform and determine what to convert the inputs to in the default_units callback, e.g.:

    def default_units(x, axis):
        if hasattr(axis.axes.get_transform(), 'expected_unit'):
            return axis.axes.get_transform().expected_unit
        ....
This is by design -- we don't want to be doing unit conversion deep in the matplotlib redraw loop.
Cadair commented 9 years ago

I don't really understand that, but it seems possible then?

astrofrog commented 9 years ago

Not clear yet, but that was a note to self :)