Hi,

following GNUplot step-plot behavior (see 
http://chem.skku.ac.kr/~wkpark/tutor/gnuplot/gpdocs/steps.htm), as 
mentionned by Peter Groszkowski (in 
http://sourceforge.net/mailarchive/message.php?msg_id=9646290), could 
the 'hsteps' linestyle be implemented in matplotlib? (as well as 
'fsteps' for sake of completness)

Here is what I currently use to mimic these different step-styles:

from pylab import *

x = array([1,3,5,7,10,12,15], dtype='d')
y = x

scatter(x, y, label='__nolegend__')

# Matplotlib original steps
plot(x, y, ls='steps', label='steps')

# Forward(?) step
xx = empty(len(x)+1, dtype=x.dtype)
xx[0] = x[0]
xx[1:] = x

yy = empty(len(x)+1, dtype=x.dtype)
yy[:-1] = y
yy[-1] = y[-1]

plot(xx, yy, ls='steps', label='fsteps')

# Histogram steps
xx = empty(len(x)+1, dtype=x.dtype)
xx[1:-1] = correlate(x, [0.5,0.5])
xx[0] = 2*x[0] - xx[1]
xx[-1] = 2*x[-1] - xx[-2]

yy = empty(len(x)+1, dtype=x.dtype)
yy[:-1] = y
yy[-1] = y[-1]

plot(xx, yy, ls='steps', label='hsteps')

legend(loc='best')
show()

Cheers.
-- 
             /  \     ,    ,
   _._     _ |oo| _  / \__/ \
  _||||   ((/ () \))   /  \      Yannick COPIN  (o:>*  Doctus cum libro
  |||||/|  ( ==== )    |oo|      Institut de physique nucleaire de Lyon
   \____/  _`\  /'_    /  \                            (IN2P3 - France)
   /   /.-' /\<>/\ `\.( () )_._  Tel: (33/0) 472 431 968
   |    `  /  \/  \  /`'--'////) http://snovae.in2p3.fr/ycopin/
    \__,-'`|  |.  |\/ |/\/\|"\"` AIM: YcCopin    ICQ: 236931013
       jgs |  |.  | \___/\___/
           |  |.  |   |    |

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to