matplotlib priorities

There are something I did't see in the list (but perhaps

    > it's possible to do now) and that I think will be useful
    > for astronomer. it's to plot an image with axes in
    > astronomical unit (RA and Dec)

    > like this function in pgplot:

    > PGPLOT Subroutine Descriptions

    > thanks for this software who are very good,

The new ticker code was designed to support exactly this kind of
application. The documentation
http://matplotlib.sourceforge.net/matplotlib.ticker.html details this
process. That code defines a lot of preset tick locators and
formatters but was primarily designed to be user extensible.

Since I'm not an astronomer, I'm probably not the best person to write
this, but it would be fairly easy to subclass
matplotlib.ticker.Locator and matplotlib.ticker.Formatter to provide
exactly this functionality.

Here is a simple example showing how to use a user defined function to
format the ticks (millions of dollars in this case)

    from matplotlib.ticker import FuncFormatter
    from matplotlib.matlab import *

    x = arange(4)
    money = [1.5e5, 2.5e6, 5.5e6, 2.0e7]

    def millions(x, pos):
        'The two args are the value and tick position'
        return '$%1.1fM' % (x*1e-6)

    formatter = FuncFormatter(millions)

    ax = subplot(111)
    ax.yaxis.set_major_formatter(formatter)
    bar(x, money)
    ax.set_xticks( x + 0.5)
    ax.set_xticklabels( ('Bill', 'Fred', 'Mary', 'Sue') )
    show()

In you case however, you would probably want to define new classes
that derive from Locator and Formatter (you can follow the example of
the many custom locators and formatters in matplotlib.ticker). If you
do, please send the classes in with an example so I can include them
in the standard distribution. If you don't want to do this, I'm sure
one of the stsci guys will do this since they have expressed interest
in this as well.

JDH

John Hunter wrote:

    > There are something I did't see in the list (but perhaps
    > it's possible to do now) and that I think will be useful
    > for astronomer. it's to plot an image with axes in
    > astronomical unit (RA and Dec)

    > like this function in pgplot:

    >
PGPLOT Subroutine Descriptions

    > thanks for this software who are very good,

The new ticker code was designed to support exactly this kind of
application. The documentation
http://matplotlib.sourceforge.net/matplotlib.ticker.html details this
process. That code defines a lot of preset tick locators and
formatters but was primarily designed to be user extensible.

Since I'm not an astronomer, I'm probably not the best person to write
this, but it would be fairly easy to subclass
matplotlib.ticker.Locator and matplotlib.ticker.Formatter to provide
exactly this functionality.

We are astronomers and we do intend to write tools to allow this.
We haven't done this yet but it is fairly high on our list
of things to do. I didn't think that such a specialized thing
was needed on the generalized goals. You are welcome to
write one if you need it sooner of course.

Perry Greenfield