newbie: how to set string ticklabels?

Hi everybody,

I tried:

import pylab
pylab.plot([“a”, “b”, “c”], [1, 2, 3])

ValueError: invalid literal for float(): a

Well,
I expected that. I wrote this to just explain my trouble: printing
strings instead float along x-axes (a sort of mapping floats to
strings…).
Writing that pylab.plot I mean that “a”, “b”, “c” were equalli spaced and “a” --> 1, “b” --> 2, “c” --> 3. I think it could be a reasonnable command. Is there something similar?

Long searches didn’t satisfy my problem.
Anybody knows the solution?
Thanks

PS sorry for bad english

···


Iacopo

pylab.plot([1,2,3], [4,5,6])
pylab.xticks([1,2,3], ['a', 'b', 'c'])

···

On 10/1/07, Iacopo <iacopo.marmo@...287...> wrote:

Hi everybody,

I tried:

>>> import pylab
>>> pylab.plot(["a", "b", "c"], [1, 2, 3])

ValueError: invalid literal for float(): a

Well, I expected that. I wrote this to just explain my trouble: printing
strings instead float along x-axes (a sort of mapping floats to strings...).
Writing that pylab.plot I mean that "a", "b", "c" were equalli spaced and
"a" --> 1, "b" --> 2, "c" --> 3. I think it could be a reasonnable command.
Is there something similar?