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.