On 10/1/07, Iacopo <iac...@gm...> 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?
pylab.plot([1,2,3], [4,5,6])
pylab.xticks([1,2,3], ['a', 'b', 'c'])
|