On 03/02/2011 06:42 AM, Mr. Python wrote:
>
> I am unable to set the color of the scatter plot points using the code below:
>
> import matplotlib
> matplotlib.use('Qt4Agg')
>
> import matplotlib.pyplot as plt
> import numpy as np
>
> plt.scatter(newSpdVals, newEngLoadVals,c='g',marker='+')

This is a bug in the handling of symstyle 2, which includes '+' and 'x'.

>
> #Add the graph title and x/y axis labels
> plt.title("Gear Span")
> plt.xlabel("Vehicle Speed (mph)")
> plt.ylabel("Engine Load %")
> plt.show()
>
> No matter what I change the c parameter to ('b','r', etc.), the color of the
> scatter plot points are always black.  The lists newSpdVals and
> newEngLoadVals have 100 dimmensions and are of type numpy.ndarray.
>
> I am using the following software and hardware:
>
> Windows XP
> Python 2.7
> PyQt4 (I launch the plot from a PyQt GUI.  I don't embed the plot in the
> GUI).
> matplotlib 1.01
>
> In the beginning of the same function where my scatter plot code is, I added
> the following code to verify if the problem is due to the matplotlib/PyQt
> interface:
>
> a = np.linspace(-10,100,33)
> b = np.linspace(-32,400,33)
> plt.scatter(a, b,color='g',marker='+')

Note the difference: here you are using a 'color' kwarg that is getting 
passed directly to the AsteriskPolygonCollection, whereas before you 
were using the 'c' kwarg that is being handled incorrectly in this case 
inside of the scatter code.

Eric

> plt.title("Gear Span")
> plt.xlabel("Vehicle Speed (mph)")
> plt.ylabel("Engine Load %")
> plt.show()
>
> The points for this plot are colored green.  I'm able to change the point
> color to blue, red, etc.
>
> Any ideas why I can't change the point color of my first graph?  Thank you
> for your help.
>
>


------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to