colorbar for figure not mappable - zap edge lines

I have a mesh of irregular polygons, like a finite element mesh. Each polygon has an associated value.
So, I have defined a color map with a appropriate normalization to define a color for each value and then
built a collection consisting of the polygon vertices and colors.
The resulting plot looks pretty good. This technique would seem to be useful for FE grids and Delaunay triangles.

Two questions:
(1) I want to attach a colorbar to the figure, but as of yet I have not worked out how to do it.
images such as scatter, imshow, pcolor are mappable and will accept a color bar but my simple polygon fill will not.

(2) How do I eliminate the edge lines about each polygon? I can make them very thin but a width of zero does not appear to work.
I recall this being discussed on the list, but now I cannot find the reference.

Thanks for any help.

--Jim

I recall John suggesting to also set the edge color (to the
same color, of course). I hope a true zero width will
implemented.

However note that interpreting a linewidth of zero as a 1
pixel wide line is what PostScript does. So the only way to
get a true zero width for PostScript output is to fill the
polygon without stroking it.

hth,
Alan Isaac

···

On Wed, 12 Jan 2005, James Boyle apparently wrote:

(2) How do I eliminate the edge lines about each polygon? I can make
them very thin but a width of zero does not appear to work.
I recall this being discussed on the list, but now I cannot find the
reference.

To reply to my own post:
On question (1):
I modified the call to colorbar in pylab.py to accept a color map and norm keyword arguments. It was this functionality that was needed from the mappable image. So if the keywords are provided colorbar uses them, otherwise it looks for a mappable image.
This modification disables the observer feature for now if the color map is a keyword, a bit more work should get this going.
It looks like it would be easily doable, but I need something for the exigencies of work and will get back to this later.
This also would allow for a colorbar key for coloring contours and vectors.
I would also like to code up a floating color bar. Often I make 4/5 images per page with a common colormap and normalization. It is
handy just to plop the reference colorbar in a central location not attached to a particular figure.

On question (2):
Alan Isaac pointed out that using the same edgecolor as the fillcolor would make the borders invisible.

--Jim

···

On Jan 12, 2005, at 12:55 PM, James Boyle wrote:

I have a mesh of irregular polygons, like a finite element mesh. Each polygon has an associated value.
So, I have defined a color map with a appropriate normalization to define a color for each value and then
built a collection consisting of the polygon vertices and colors.
The resulting plot looks pretty good. This technique would seem to be useful for FE grids and Delaunay triangles.

Two questions:
(1) I want to attach a colorbar to the figure, but as of yet I have not worked out how to do it.
images such as scatter, imshow, pcolor are mappable and will accept a color bar but my simple polygon fill will not.

(2) How do I eliminate the edge lines about each polygon? I can make them very thin but a width of zero does not appear to work.
I recall this being discussed on the list, but now I cannot find the reference.

Thanks for any help.

--Jim

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options