IndexFormatter missing

Anyone know what happened to

    > matplotlib.ticker.IndexFormatter? Is there are replacement
    > for it?

I don't know -- I don't see anything in the changelog or in the svn
log. What did it do, and what version of mpl had it? Sorry, but my
memory is failing here... I don't see any IndexFormatter as far back
as 0.83. There is an index locator however....

Perhaps you should just tell us what you want to do.

JDH

I managed to accomplish what I wanted to do, using the FuncFormatter I think… Here’s what I was doing. I am plotting results of graphs, graphs which have a certain number of edges. So I wanted to plot some statistic vs. number of edges. But the number of edges was not varied in a linear way but I have a list of which edges. So:

edges=[54, 76, 80, 100]
stats=[5.423, 23.226, 4.1, 6.93]

So basically I wanted t=arange(len(stats) as my x-axis but edges for the labels (but only if it lies on a major tic). So I did:

majorFormatter = ticker.FuncFormatter(lambda x, pos: labels[int(x)])
axis.xaxis.set_major_formatter(majorFormatter)

If anyone knows a better way I would love to know. I’m just learning matplotlib (I’m a former matlab user) and would love to master it.

···

On 7/12/06, John Hunter <jdhunter@…4…> wrote:

> Anyone know what happened to
> matplotlib.ticker.IndexFormatter

? Is there are replacement
> for it?

I don’t know – I don’t see anything in the changelog or in the svn
log. What did it do, and what version of mpl had it? Sorry, but my
memory is failing here… I don’t see any IndexFormatter as far back

as 0.83. There is an index locator however…


David Grant
Please Note my new email address: davidgrant@…287…