Is this the only way to plot a sin from x=0 to x=2pi, but shade where x>0.25pi 
and x<0.75pi?

x0 = np.linspace(0.0, 0.25*np.pi, 100)
x1 = np.linspace(0.25*np.pi, 0.75*np.pi, 100)
x2 = np.linspace(0.75*np.pi,2*np.pi, 100)

y0 = np.sin(x0)
y1 = np.sin(x1)
y2 = np.sin(x2)

fig = figure()
ax1 = fig.add_subplot(111)

ax1.plot(x0,y0)
ax1.fill_between(x1,0,y1)
ax1.plot(x2,y2)
show() 

thanks

Marc Desmarais





      
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to