plotting years and months

This is such a noob question but I can't seem to find the answer anywhere. I
have a certain amount of something per month which I want to display on the
y axis, I want the x axis to show years and months, i.e. it runs from 2003
to 2009. I have no problem with the python side, just the plotting side. How
do I do it?

···

--
View this message in context: http://www.nabble.com/plotting-years-and-months-tp24556407p24556407.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

matplotlib can plot native datetime objects, so if dates is a list of
datetimes, and vals is a list of values, you can:

  ax.plot(dates, vals)

See also these code examples:

  Search — Matplotlib 3.8.2 documentation

and the dates API documentation:

  http://matplotlib.sourceforge.net/api/dates_api.html

JDH

···

On Sun, Jul 19, 2009 at 7:03 AM, willemmerson<willemmerson@...287...> wrote:

This is such a noob question but I can't seem to find the answer anywhere. I
have a certain amount of something per month which I want to display on the
y axis, I want the x axis to show years and months, i.e. it runs from 2003
to 2009. I have no problem with the python side, just the plotting side. How
do I do it?