This blog has moved! It is now hosted at
http://keflavich.github.io/blog/
http://keflavich.github.io/blog/
A blog about astrophysics & computing. More info about me @ Adam Ginsburg's page
def steppify(arr,isX=False,interval=0):
"""
Converts an array to double-length for step plotting
"""
if isX and interval==0:
interval = abs(arr[1]-arr[0]) / 2.0
newarr = array(zip(arr-interval,arr+interval)).ravel()
return newarr
plot(xx,yy,linestyle='steps-mid',color='b',linewidth=1.5)
fill_between(steppify(xx[x1:x2],isX=True),
steppify(yy[x1:x2])*0,
steppify(yy[x1:x2]),
facecolor='b',alpha=0.2)