[Matplotlib-users] I need to force the "rounding" of x axis limits

2015-04-06 Thread giacomo boffi
INTRO
=

please consider the following code (I'm trying to draw a timeline)

1 from matplotlib import pyplot, patches
2 fig = pyplot.figure()
3 ax = fig.add_subplot('111')
4 ax.add_patch(patches.Rectangle((1933,0.25), 73, 0.5))
5 pyplot.show()

that gives me a plot with the x axis that goes from 0.0 to 1.0,
now consider

  ...
5 ax.set_xlim((1933,1933+73))
6 pyplot.show()

this gives me an x axis that goes _exactly_ from 1933 to 2006,
eventually drawing a line superposed to the lower spine

  ...
5 ax.plot((1933,1933+73),(0,0))
6 pyplot.show()

gives me what I really want, that is an x axis running from 1930 to
2010, with the limits automatically rounded by matplotlib...

(I noted that the extra line forces a rounding also for the y axis
limits, but that's not a problem...)

QUESTION


I want matplotlib to round the limits of the x axis automatically,
when given explicitly the lower and upper limits of the data, how to?

Thank you in advance

-- 
"We have met the enemy and he is us."
--- Pogo.


--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] subplots [xy]labels

2013-01-04 Thread giacomo . boffi
Alex Goodman 
writes:

> Try using the set_ylabel() and set_xlabel() methods for each Axes instance
> instead, eg:
>
> a[0].set_ylabel('f1')
> ...

works as intended, tx Alex


--
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] subplots [xy]labels

2013-01-04 Thread giacomo . boffi
two plots in a figure:

from pylab import *
...
f,a = subplots(nrows=2, sharex=False, sharey=False)
a[0].plot(x,f0(x))
ylabel('f1')
xlabel('t')
...
a[1].plot(x,f1(x))
ylabel('f2')
xlabel('t')
...
show()

but all i can get are labels for ONLY the lower subplot, what shoud I do?

any help will be appreciated

tia
gb


--
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users