fill question

How do I suppress drawing a line around the polygon when

    > using fill? I've tried fill(x,y,'gray',linewidth=0), but I
    > still get a little tiny line (which is especially noticeable
    > when using the postscript backend).

Just make the facecolor and edgecolor the same

  >>> fill(x,y, edgecolor='gray', facecolor='gray)

or whatever color you want them to be. You can also use aliases

  >>> fill(x,y, ec='gray', fc='gray)

FYI, the new set/get introspection is designed to help you find these
things, by printing property names and the values they accept

In [3]: p, = fill(x,y)

In [4]: p
Out[4]: <matplotlib.patches.Polygon instance at 0x3b5ec60>

In [5]: set(p)
    alpha: float
    antialiased or aa: [True | False]
    clip_box: a matplotlib.transform.Bbox instance
    clip_on: [True | False]
    edgecolor or ec: any matplotlib color - see help(colors)
    facecolor or fc: any matplotlib color - see help(colors)
    figure: a matplotlib.figure.Figure instance
    fill: [True | False]
    label: any string
    linewidth or lw: float
    lod: [True | False]
    transform: a matplotlib.transform transformation instance
    visible: [True | False]
    zorder: any number

Hope this helps,
JDH

    > How do I suppress drawing a line around the polygon when
    > using fill? I've tried fill(x,y,'gray',linewidth=0), but I
    > still get a little tiny line (which is especially noticeable
    > when using the postscript backend).

Just make the facecolor and edgecolor the same

I'll chime in here because I know someone is creating arrows
using polygons. I have found that *any* width along the
edge is a problem for arrows: they must be *only* filled and
not stroked or they look like they point to the wrong point.
(Perhaps 0.3 point unscaled would not be a serious problem
for many uses, but remember there is a join at the tip!)
So: is it possible to fill a polygon without stroking the
edge (or to set the edge with to approximate 0)?

By way of comment: this was a real problem in gnuplot up to
version 3.8. (I've been meaning to check whether it was
fixed in 4.0.) The arrows were stroked as well as filled,
and they often looked very wrong.

fwiw,
Alan Isaac

···

On Tue, 28 Dec 2004, John Hunter apparently wrote:

John Hunter wrote:

"Jeff" == Jeff Whitaker <jswhit@...146...> writes:
           
   > How do I suppress drawing a line around the polygon when
   > using fill? I've tried fill(x,y,'gray',linewidth=0), but I
   > still get a little tiny line (which is especially noticeable
   > when using the postscript backend).

Just make the facecolor and edgecolor the same

John: Thanks - I figured that one out myself about 5 minutes after I sent the message.

I'm currently working on a map plotting module. I've added the ability to plot filled continents on various map projections, using the GSHHS coastline polygon dataset (http://www.soest.hawaii.edu/wessel/gshhs/gshhs.html). This dataset provides polygon segments that define continental outlines. However, before I post it here I'd like to also provide the capability to fill the 'wet' areas as well. In order to do this I need to figure out how to fill the area between the polygons. Looks like this module (http://www.dezentral.de/soft/Polygon/index.html) would do the trick, but it requires the generaly polygon clipping C library. Do you have any suggestions?

Thanks for you help,

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/CDC R/CDC1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Web : www.cdc.noaa.gov/~jsw
Boulder, CO, USA 80303-3328 Office : Skaggs Research Cntr 1D-124