Filled Curves

Hi,

I am a new user of matplotlib.
First of all I would like to say that the people working on matplotlib is doing a great job.

Well, I have tried to use the ‘fill’, but I cannot get rid of the lines.
I have tried to use ‘linewidth=0’ at the end, but it did not work.

Could somebody, please, tell me if I am doing something wrong ?

Thank you.
Sergio.

···

#!/usr/bin/env python

from pylab import *

from matplotlib.patches import Polygon

t = arange(0.0, 1.0+0.01, 0.01)
s1 = t
s2 = tt
s3 = t
t*t

text(0.50, 0.4,
r"$d(f_2,f_3)$", horizontalalignment=‘center’,
color= ‘#8f0100’, fontsize=30)

xticks(size=20)
yticks(size=20)

fill(t, s3, ‘#e9ccce’, linewidth=0)
fill(t, s2, ‘w’, linewidth=0)

savefig(‘diamxn2.eps’)

Sergio,
I think the line you see comes from plotting two shape on top one another. You
may want to redefine your polygon:
the easier would be something like:

tt = concatenate((t,t[::-1]))
vtx = concatenate((s3,s2[::-1]))
fill(tt, vtx, '#e9ccce', linewidth=0)

With the first command, you build a series of x coordinates from 0 to 1.01 and
back to 0 (that's the t[::-1])
with second, you build the y ccordinates sequence, by taking the corresponindg
point of s3, and then from s2 in reverse order.
Now, your polygon is fully defined.