|
From: John H. <jdh...@ac...> - 2004-09-28 16:38:38
|
>>>>> "Andrew" == Andrew Straw <str...@as...> writes:
Andrew> The fill() command itself does work if you give it
Andrew> coordinates for a closed polygon. This draws a filled
Andrew> spiral:
Of course (slaps self on forehead). So my example rewritten would be
rewritten using the cleaner
from matplotlib.matlab import *
x1 = arange(0, 2, 0.01)
y1 = sin(2*pi*x1)
y2 = sin(4*pi*x1) + 2
# reverse x and y2 so the polygon fills in order
x = concatenate( (x1,x1[::-1]) )
y = concatenate( (y1,y2[::-1]) )
p = fill(x, y, facecolor='g')
set(p, alpha=0.5)
show()
I took the liberty of adding your example to CVS in the examples
subdir as examples/fill_spiral.py.
Thanks!
JDH
|