[Tutor] pylab axis

Danny Yoo dyoo at hashcollision.org
Thu May 29 20:09:22 CEST 2014


> My problem concerns forcing pylab to give me the y axis I want.
>
> My code is as follows:
>
> pylab.figure(10)
> pylab.title("Ratio of realised capital to advanced capital.")
> pylab.xlabel("Time [Cycles of Capital reproduction]")
> pylab.ylabel("Ratio of realised capital to advanced capital.")
> pylab.xlim = ((0.0, 1.5))
> pylab.plot(cycles, ratiocrtoca)
> pylab.show(10)
>
>
> My problem is that I wish to force the y axis to simply be from 0.0 to 1.5
> without the detail which is just arithmetic noise, I think.

It appears that you limit the x-axis's bounds by using pylab.xlim().
Have you tried doing the same with pylab.ylim()?


I'm unfamilar with pylab, but have found a tutorial in:
http://jakevdp.github.io/mpl_tutorial/tutorial_pages/tut1.html.

I think that 'ylim' is what you're looking for, but I'm not positive yet.


More information about the Tutor mailing list