Can't set scatter plot point color

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='+')
               
#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='+')
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.

···

--
View this message in context: http://old.nabble.com/Can't-set-scatter-plot-point-color-tp31051071p31051071.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

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

···

On 03/02/2011 06:42 AM, Mr. Python wrote:

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.

Thank you for the reply.

I discovered this myself yesterday. Now I have an official answer if people
want a colored + or the x symbol in the scatter plot.

Scott Hansen

efiring wrote:

···

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

--
View this message in context: http://old.nabble.com/Can't-set-scatter-plot-point-color-tp31051071p31070224.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Dear,

Please also note that ‘+’ and ‘x’ are “lines”, hence if you want them coloured, you’ll need to set edgecolor=“g” rather than just color=‘g’ …

HTH

Thom

···

Dr Thomas Lecocq
Geologist
Seismology
Royal Observatory of Belgium


Date: Fri, 4 Mar 2011 10:49:09 -0800
From: scott.hansen@…3459…8…
To: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Can’t set scatter plot point color

Thank you for the reply.

I discovered this myself yesterday. Now I have an official answer if people
want a colored + or the x symbol in the scatter plot.

Scott Hansen

efiring wrote:

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@…813…ourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


View this message in context: http://old.nabble.com/Can't-set-scatter-plot-point-color-tp31051071p31070224.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


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

Dear,

Please also note that '+' and 'x' are "lines", hence if you want them
coloured, you'll need to set edgecolor="g" rather than just color='g' ...

Exactly, but in the scatter context one shouldn't have to do this. I consider it a bug, so I will shortly commit a fix. Markers that have no face showing, only edge, should still behave as expected when a "c" kwarg is supplied. I think this is what one would expect based on the docstring.

Eric

···

On 03/06/2011 09:14 PM, Thomas Lecocq wrote:

HTH

Thom

**********************
Dr Thomas Lecocq
Geologist
Seismology
Royal Observatory of Belgium
**********************

> Date: Fri, 4 Mar 2011 10:49:09 -0800
> From: scott.hansen@...3458...
> To: matplotlib-users@lists.sourceforge.net
> Subject: Re: [Matplotlib-users] Can't set scatter plot point color
>
> Thank you for the reply.
>
> I discovered this myself yesterday. Now I have an official answer if
people
> want a colored + or the x symbol in the scatter plot.
>
> Scott Hansen
>
> efiring wrote:
> >
> > 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
> >
>
> --
> View this message in context:
http://old.nabble.com/Can't-set-scatter-plot-point-color-tp31051071p31070224.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
------------------------------------------------------------------------------
> 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

------------------------------------------------------------------------------
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

I always did wonder what the difference was between ‘c’ and ‘color’. We should definitely make this clearer in the docs. Obviously, the ‘c’ argument should always work because the user shouldn’t have to know the difference. Those who do know the difference can continue using the appropriate kwargs for advanced control.

Ben Root

···

On Mon, Mar 7, 2011 at 1:29 AM, Eric Firing <efiring@…2015…02…> wrote:

On 03/06/2011 09:14 PM, Thomas Lecocq wrote:

Dear,

Please also note that ‘+’ and ‘x’ are “lines”, hence if you want them

coloured, you’ll need to set edgecolor=“g” rather than just color=‘g’ …

Exactly, but in the scatter context one shouldn’t have to do this. I

consider it a bug, so I will shortly commit a fix. Markers that have no

face showing, only edge, should still behave as expected when a “c”

kwarg is supplied. I think this is what one would expect based on the

docstring.

Eric