Visit Jeremy's Blog.
 Home Forums HCL Reviews Tutorials Articles Register Search Today's Posts Mark Forums Read
 LinuxQuestions.org matplotlib--graphing against time
 Programming This forum is for all programming questions. The question does not have to be directly related to Linux and any language is fair game.

Notices

 06-01-2009, 01:29 PM #1 pgb205 Member   Registered: Nov 2007 Posts: 109 Rep: matplotlib--graphing against time let 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 at periodic intervals. Anyone can suggest how to do this exactly? thanks
06-01-2009, 02:35 PM   #2
Sergei Steshenko
Senior Member

Registered: May 2005
Posts: 4,481

Rep:
Quote:
 Originally Posted by pgb205 let 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 at periodic intervals. Anyone can suggest how to do this exactly? thanks

http://www.mathworks.com/access/help...p=mss&ei=UTF-8 ->

Specifying Tick-Mark Location and Labeling ->

Code:
```set(gca,'XTick',-pi:pi/2:pi)
set(gca,'XTickLabel',{'-pi','-pi/2','0','pi/2','pi'})```