On Thu, Aug 19, 2010 at 5:03 PM, Ethan Swint <[email protected]> wrote:
> Hi-
>
> I'm trying to plot an XY line graph with discrete XY pairs in it with a
> step response between each pair. In other words, on the range [X1,X2),
> it should have a horizontal line at Y1, at X2, the line goes vertical
> from Y1 to Y2, then on the range [X2,X3), it should have a horizontal
> line at Y2. I haven't seen any examples yet, and my forays into the
> documentation haven't yielded up a simple way to do this. Is there a
> simple option to do this, or do I have to pad my data with X1,
> X2-epsilon, X2, X3-epsilon, etc.
What you're looking for is the step() plotting function:
step(x, y, *args, **kwargs)
Make a step plot. Additional keyword args to :func:`step` are the same
as those for :func:`~matplotlib.pyplot.plot`.
*x* and *y* must be 1-D sequences, and it is assumed, but not checked,
that *x* is uniformly increasing.
Keyword arguments:
*where*: [ 'pre' | 'post' | 'mid' ]
If 'pre', the interval from x[i] to x[i+1] has level y[i+1]
If 'post', that interval has level y[i]
If 'mid', the jumps in *y* occur half-way between the
*x*-values.
Ryan
--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
------------------------------------------------------------------------------
This SF.net email is sponsored by
Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users