plotting with marker 'o' but not filled

Hi List,

I use Fink for Mac OSX, tiger 10.4.11.

So with MPL 0.90.1, this script works fine:

from matplotlib.pylab import *
import matplotlib, numpy
print matplotlib.__version, numpy.__version__
att1 = {'color': 'black', 'markerfacecolor': 'red', 'markersize':
80.0, 'markeredgewidth': 1.0, 'alpha': 1.0, 'marker': 's',
'markeredgecolor': 'blue'}
att2 = {'color': 'black', 'markerfacecolor': None, 'markersize': 8.0,
'markeredgewidth': 1.0, 'alpha': 1.0, 'marker': 'o',
'markeredgecolor': 'blue'}
plot([0],[0], **att1)
plot([0],[0], **att2)
show()

I got just a blue circle line (not filled) over a red square. However,
trying the same script with updated MPL 0.91.3, I got:

[snip]
  File "/sw/lib/python2.5/site-packages/matplotlib/colors.py", line
279, in to_rgb
    raise ValueError('to_rgb: Invalid rgb arg "%s"\n%s' % (str(arg), exc))
ValueError: to_rgb: Invalid rgb arg "None"
cannot convert argument to rgb sequence

Bottom line, version 0.91.3 simply doesn't like 'markerfacecolor':
None anymore.

So, is it a bug, or there's another way of getting a simple circle not filled?

Many thanks in advance,
Alan

···

--
Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.

http://www.bio.cam.ac.uk/~awd28<<

Hi List,

I use Fink for Mac OSX, tiger 10.4.11.

So with MPL 0.90.1, this script works fine:

from matplotlib.pylab import *
import matplotlib, numpy
print matplotlib.__version, numpy.__version__
att1 = {'color': 'black', 'markerfacecolor': 'red', 'markersize':
80.0, 'markeredgewidth': 1.0, 'alpha': 1.0, 'marker': 's',
'markeredgecolor': 'blue'}
att2 = {'color': 'black', 'markerfacecolor': None, 'markersize': 8.0,
'markeredgewidth': 1.0, 'alpha': 1.0, 'marker': 'o',
'markeredgecolor': 'blue'}
plot([0],[0], **att1)
plot([0],[0], **att2)
show()

I got just a blue circle line (not filled) over a red square. However,
trying the same script with updated MPL 0.91.3, I got:

[snip]
File "/sw/lib/python2.5/site-packages/matplotlib/colors.py", line
279, in to_rgb
   raise ValueError('to_rgb: Invalid rgb arg "%s"\n%s' % (str(arg), exc))
ValueError: to_rgb: Invalid rgb arg "None"
cannot convert argument to rgb sequence

Bottom line, version 0.91.3 simply doesn't like 'markerfacecolor':
None anymore.

Could you try setting 'markerfacecolor' to 'none' (Note that this is the string, not the keyword). I'm on version 0.98.2, but I think this worked when I was using 0.91.3. I'm not sure why this change was made, though.

Best,
-Tony

···

On Jul 12, 2008, at 1:50 PM, Alan wrote:

So, is it a bug, or there's another way of getting a simple circle not filled?

Many thanks in advance,
Alan
--
Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.

http://www.bio.cam.ac.uk/~awd28<<

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Tony S Yu wrote:

Hi List,

I use Fink for Mac OSX, tiger 10.4.11.

So with MPL 0.90.1, this script works fine:

from matplotlib.pylab import *
import matplotlib, numpy
print matplotlib.__version, numpy.__version__
att1 = {'color': 'black', 'markerfacecolor': 'red', 'markersize':
80.0, 'markeredgewidth': 1.0, 'alpha': 1.0, 'marker': 's',
'markeredgecolor': 'blue'}
att2 = {'color': 'black', 'markerfacecolor': None, 'markersize': 8.0,
'markeredgewidth': 1.0, 'alpha': 1.0, 'marker': 'o',
'markeredgecolor': 'blue'}
plot([0],[0], **att1)
plot([0],[0], **att2)
show()

I got just a blue circle line (not filled) over a red square. However,
trying the same script with updated MPL 0.91.3, I got:

[snip]
File "/sw/lib/python2.5/site-packages/matplotlib/colors.py", line
279, in to_rgb
   raise ValueError('to_rgb: Invalid rgb arg "%s"\n%s' % (str(arg), exc))
ValueError: to_rgb: Invalid rgb arg "None"
cannot convert argument to rgb sequence

The error message is somewhat misleading in this case because of the quotes; it is failing on the Python object None, not the string "None".

Bottom line, version 0.91.3 simply doesn't like 'markerfacecolor':
None anymore.

Could you try setting 'markerfacecolor' to 'none' (Note that this is the string, not the keyword). I'm on version 0.98.2, but I think this worked when I was using 0.91.3. I'm not sure why this change was made, though.

We have been trying to move to the following standard for kwargs:

None (the Python object) means "use the default", usually an rcParams setting. (In the case of markerfacecolor, it is not an rcParams value, it is the 'color' value.)

'none' or 'None' means "no color".

There is indeed a bug in the present code: 'markerfacecolor': None is raising an error because it is supposed to be converted to the default, which is 'auto', but when it is input as a plot kwarg, it isn't. I will have that fixed shortly in the two svn branches.

Eric

···

On Jul 12, 2008, at 1:50 PM, Alan wrote:

Best,
-Tony

So, is it a bug, or there's another way of getting a simple circle not filled?

Many thanks in advance,
Alan