hi,

On Mon, Jun 1, 2009 at 20:08, pgb205 <paulbaranovs...@optonline.net> 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

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to