hi,
On Mon, Jun 1, 2009 at 20:08, pgb205 <pau...@op...> wrote:
>
> et say i have two arrays
> time_array=[00:00:00,00:00:10...17:59:50,18:00:00]
> and
> data_array=[1,12..34,2]
> both of them with the same number of elements.
> I want to graph data_array on y axis vs time_array on x_axis.
> However, I'm unable to do this using matplotlib because it complains
> time_array is not in numeric form.
> I guess I should do plot=(data_array) and somehow mark the x axis with
> time_array data at periodic intervals. Any suggestion on how to mark x-axis
> with times?
Plotting data against time needs this:
- x data values has to be datetime objects (so you have to convert to that)
- you have to use plot_data() instead of plot()
- adjust X axes formatter and locato with date formatter and locator
hope this reference will guide you trhu mpl documentation to have a
working program; in the gallery in the website you can also find an
example for date plotting.
Cheers,
--
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
|