On 8/14/07, Matthew Auger <[EMAIL PROTECTED]> wrote:
> This demonstrates the *solution*--the problem is that scatter() does not
> automagically perform color mapping for the edge and face colors.

Indeed...and I wish the behavior was more like other mpl functions.
Either way, passing my list through a colormap did not solve the issue
(for me). If I call:

 scatter(x,y,s,c)

then I get a scatter plot where the points are different sizes and
colors.  Without specifying the keyword 'edgecolor', it is not
possible to have varying edge colors.  For consistency, I set the
facecolors through a keyword as well. So, I would like to be able to
make the following command:

 scatter(x,y,s, facecolor=cm.jet(c),  edgecolor=cm.jet(ec))

where, as noted, we must manually map the colors when specifying via
keywords.  However, when I run the above command, I do not get a
scatter plot with varying sizes, colors, and edgecolors.  Instead, I
get varying sizes, all points with 'b' as a facecolor, and all points
with 'k' as an edgecolor.

I've tried to figure this out...comments are requested...

I am looking at axes.py/scatter now....

When I make the above statement, c takes on its default value (which
is 'b').  The function sees that c is string like and converts it to a
rgba_list.  Since 'faceted' defaults to True, edgecolors=None.

Now we go through and create the *PolyCollection. For 'facecolors' we
pass in 'b'...and for 'edgecolors' we pass in None.  After creation,
collection.update(kwargs) is called.

As I understand it, this is what *should* happen when the update
method is called:  The collection should take my keywords 'facecolor'
and 'edgecolor' and assign  them to self._facecolors and
self._edgecolors. This does occur (as my first reply demonstrated).
It seems what should *also* happen is that the  facecolors/edgecolors
of the points should be updated...but this does not occur.

Do you (or does anybody) have a working, simple example where the
faces/edges are both varying for a scatter plot?  Perhaps I've missed
something obvious.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to