| 
     
      
      
      From: Ryan K. <rya...@gm...> - 2009-05-15 23:59:42
      
     
   | 
RTFM: plot(t,y, drawstyle='steps-post') This was really helpful: http://matplotlib.sourceforge.net/examples/pylab_examples/set_and_get.html especially >>> line, = plot([1,2,3]) >>> setp(line, linestyle='--') On Fri, May 15, 2009 at 6:52 PM, Ryan Krauss <rya...@gm...> wrote: > Oh, and in case it matters I am running > > In [36]: matplotlib.__version__ > Out[36]: '0.98.5.2' > > on Ubuntu 9.04 (with the rather lame name of Jaunty Jackolope). > > > On Fri, May 15, 2009 at 6:51 PM, Ryan Krauss <rya...@gm...> wrote: > >> I think I used to use plot with linestyle='steps' to plot data for >> zero-order hold control systems. This means that if the system is updating >> on a period of 0.01 seconds (100 Hz), the values should be considered held >> from 0 to 0.0099999999999999 and then from 0.01 to 0.01999999999 and so on >> each time step. So, what I want is a plot that looks like late_steps.png >> (hopefully attached), but what I am currently getting is early_steps.png. >> >> This code snippet recreates my problem. My t2 hack almost makes the plot >> look right. >> >> t = arange(0,0.1,0.01) >> y = 10*t >> clf() >> plot(t,y,linestyle='steps') >> plot(t,y,'o') >> savefig('early_steps.png') >> >> t2 = t+0.01 >> clf() >> plot(t2,y,linestyle='steps') >> plot(t,y,'o') >> savefig('late_steps.png') >> >> >> >> Is this a bug, is this the expected behavior for other applications, or >> can this be changed with some configuration setting? >> >> Thanks, >> >> Ryan >> > >  |