xticks() shifted by 1

Maybe what you want is xtick_labels()? xticks() merely tells mpl where on the x-axis you want ticks to show up. xtick_labels() will tell mpl what to label each tick (but won’t change how many there are and where they are placed).

Ben Root

···

On Sat, Sep 17, 2011 at 3:22 PM, Klonuo Umom <klonuo@…287…> wrote:

Thanks for your fast replies.

One more thing if possible: How can I tell xticks() to start at 0 (at x-axis start)

Hm.. it not within matplotlib.pyplot module... needs more digging
OK, thanks

···

On Sat, Sep 17, 2011 at 10:27 PM, Benjamin Root <ben.root@...1304...> wrote:

On Sat, Sep 17, 2011 at 3:22 PM, Klonuo Umom <klonuo@...287...> wrote:

Thanks for your fast replies.
One more thing if possible: How can I tell xticks() to start at 0 (at x-axis start)

Maybe what you want is xtick_labels()? xticks() merely tells mpl where on the x-axis you want ticks to show up. xtick_labels() will tell mpl what to label each tick (but won't change how many there are and where they are placed).

Ben Root

Sorry, I am used to working from the axes objects, not from the pyplot interface. Most of the axes methods are available to pyplot, but it looks like Axes.set_xticklabels() is not available to pyplot.

But honestly, I think you are making this harder than it is. The line being drawn starts at (0, 0) coordinates. The plot is correct, and I am not sure what you are trying to acheive.

Ben Root

···

On Sat, Sep 17, 2011 at 3:33 PM, Klonuo Umom <klonuo@…287…> wrote:

Hm… it not within matplotlib.pyplot module… needs more digging

OK, thanks

On Sat, Sep 17, 2011 at 10:27 PM, Benjamin Root <ben.root@…1304…> wrote:

On Sat, Sep 17, 2011 at 3:22 PM, Klonuo Umom <klonuo@…287…> wrote:

Thanks for your fast replies.

One more thing if possible: How can I tell xticks() to start at 0 (at x-axis start)

Maybe what you want is xtick_labels()? xticks() merely tells mpl where on the x-axis you want ticks to show up. xtick_labels() will tell mpl what to label each tick (but won’t change how many there are and where they are placed).

Ben Root

I want to plot multiple plot lines, and would prefer lines to start at
x-axis beginning (so they "source" vertically from y-axis)
If I use suggested method from current replies lines would not start
from x-axis beginning, but I guess I'll need to look in Axes module
and make my preferences.
Thanks

···

On Sat, Sep 17, 2011 at 10:42 PM, Benjamin Root <ben.root@...1304...> wrote:

Sorry, I am used to working from the axes objects, not from the pyplot
interface. Most of the axes methods are available to pyplot, but it looks
like Axes.set_xticklabels() is not available to pyplot.

But honestly, I think you are making this harder than it is. The line being
drawn starts at (0, 0) coordinates. The plot is correct, and I am not sure
what you are trying to acheive.

Ben Root

Or you could set the x-axis limits…

Ben Root

···

On Sat, Sep 17, 2011 at 3:51 PM, Klonuo Umom <klonuo@…287…> wrote:

I want to plot multiple plot lines, and would prefer lines to start at

x-axis beginning (so they “source” vertically from y-axis)

If I use suggested method from current replies lines would not start

from x-axis beginning, but I guess I’ll need to look in Axes module

and make my preferences.

Thanks

Yes, that seems the right way
I used it before but forgot it in the mean time

···

On Sat, Sep 17, 2011 at 10:56 PM, Benjamin Root <ben.root@...1304...> wrote:

On Sat, Sep 17, 2011 at 3:51 PM, Klonuo Umom <klonuo@...287...> wrote:

I want to plot multiple plot lines, and would prefer lines to start at
x-axis beginning (so they "source" vertically from y-axis)
If I use suggested method from current replies lines would not start
from x-axis beginning, but I guess I'll need to look in Axes module
and make my preferences.
Thanks

Or you could set the x-axis limits...

Ben Root