I’m new to matplotlib but have really been appreciating the thorough documentation and examples online. I’ve never worked with matlab either so I’m stumbling my way around a bit, but have managed to get some basic plots working with my wxPython program.
I’m plotting some simple time/temp curves. For the time, I have just the number of seconds, starting at 0 and going up to about 1200 (20 minutes). I’m trying to format the xaxis so that there is a tick mark every one minute, and format the tick marks so they display %M:%S. The code below doesn’t give me any formatting or tick marks on the xaxis. It seems like this should be fairly obvious how to accomplish, but I’m not getting it.
What am I doing wrong here?
xvals = range(1200)
yvals = list of temps
self.mainline = self.ax.plot(xvals, yvals, lw=2, color=‘red’)
locator = matplotlib.dates.MinuteLocator()
formatter = matplotlib.dates.DateFormatter(’%M:%S’)
draw the canvas
Any help appreciated…thanks!