patchcollection wihtout edgecolor and gradient filled patches

Hi,

I use a small script to read the elments of a vtk-file and plot them as polygons,
therefore I create polygons with

    polygon = Polygon(coordinates)

and collect them as patches:

    patches.append(polygon)

afterwards I plot all patches with:

   p = PatchCollection(patches, alpha = 1.0,cmap = mpl.cm.Blues,linewidth="0.0" \
          ,edgecolor="black",linewidth="0.0")
   ax.add_collection(p)
   p.set_clim(vmin=0.0,vmax=1.0)
   p.set_array(np.array(patchColor))

My "stupid" idea was to use linewidth = 0.0 to draw patches with no visible edges. However,
it does not work, there are allways some lines, sometimes they look like artefacts.

Is there some simple solution to draw a patch collection with no edges or to set the edgecolor to the
facecolor? I believe that for single polygons the color = XY comand should work.

The second question is if it is possible to fill patches with color gradients based on corner values?

Thank you verry much for anny help and suggestions.
I like matplotlib and I know that it was not developed for the stuff I'm doing,
but I don't like to part with matplotlib since it is such a powerfull tool

Leopold Stadler

(sorry for my broken english, my first mail to an email-list)

···

______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

Is there some simple solution to draw a patch collection with no edges or to set the edgecolor to the
facecolor? I believe that for single polygons the color = XY comand should work.

While I believe that setting linewidth=0 will prevent edge-drawing,
see if edgecolor="none" works.
It is hard to tell without any screenshot. So please post a complete
code and a screenshot if possible. My guess is that what you see is an
artifact of antialiasing.

The second question is if it is possible to fill patches with color gradients based on corner values?

The svn version of mpl has a support for gouraud shading. other than
that there is no support of gradient in mpl as far as I know. You may
create your own gradient image as in the example below.

http://matplotlib.sourceforge.net/examples/pylab_examples/gradient_bar.html

Regards,

-JJ

···

On Fri, Sep 25, 2009 at 8:53 AM, Leopold Stadler <LeopoldStadler@...273...> wrote: