unfilled markers?

Sorry this is a basic question but I can't figure out where
in the docs nor archives I could find this.

Is there a built in method for having unfilled markers?
(ones that match the line color).

I could set mfc (marker face color) to white and
mec (marker edge color) to the color of my line, but
what if I don't know the color (because it is generated
through the mpl color cycler)?

Thanks.

mfc="None" does the job. mec should then default to the line color.

C M wrote:

···

Sorry this is a basic question but I can't figure out where
in the docs nor archives I could find this.

Is there a built in method for having unfilled markers?
(ones that match the line color).

I could set mfc (marker face color) to white and
mec (marker edge color) to the color of my line, but
what if I don't know the color (because it is generated
through the mpl color cycler)?

Thanks.

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

mfc=“None” does the job. mec should then default to the line color.

Hmm, I just tried that and it doesn’t default to the line color, it
instead makes a black edge color for the marker. I am still using

version 0.90.1; is this a newer feature in the latest release? (yes, I
will upgrade, just been pokey about it since I was working on other
issues).

I don’t remember when I worked on this issue, but it may well be that it was after

0.90.1

Well, I just upgraded matplotlib to the latest, 0.98.5.2, and it is still not making the colors of the marker edges match the lines. They’re still black, despite the various lines being red, blue, green…

This is with the wxAgg backend. The line in my code is:

line = self.subplot.plot_date(dates,values,’-o’,picker=5, lw=2,
markersize=9, mfc=“None”)

(Also, since upgrading, now I have a number of things that have changed/are not working in my app, will have to change, but that’s probably for the better since I know there are some nice new features in mpl)

Any ideas?

Thanks,
Che

···

C M wrote:

Sorry this is a basic question but I can’t figure out where
in the docs nor archives I could find this.

Is there a built in method for having unfilled markers?
(ones that match the line color).

I could set mfc (marker face color) to white and
mec (marker edge color) to the color of my line, but

what if I don’t know the color (because it is generated
through the mpl color cycler)?

Thanks.


This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Sorry for my misleading words - I did not correctly recall my own work from back then...

In fact, the code as it is does not change the mec automatically when the mfc of a filled_marker is set to "None" but leaves it black. I did consider adding an automation to change but decided against it. The logic would have become too complex and hard to predict.

What you can do is setting the mec afterwards using get_color on the plot like

    pl, = plot(x,y,"-o",mfc="None")
    pl.set_mec(pl.get_color())

Hope that helps?

Greetings,
Norbert

C M wrote:

···

>>> mfc="None" does the job. mec should then default to the line color.

>> Hmm, I just tried that and it doesn't default to the line color, it
>> instead makes a black edge color for the marker. I am still using
>> version 0.90.1; is this a newer feature in the latest release? (yes, I
>> will upgrade, just been pokey about it since I was working on other
>> issues).

> I don't remember when I worked on this issue, but it may well be that it was after
> 0.90.1

Well, I just upgraded matplotlib to the latest, 0.98.5.2, and it is still not making the colors of the marker edges match the lines. They're still black, despite the various lines being red, blue, green...

This is with the wxAgg backend. The line in my code is:

line = self.subplot.plot_date(dates,values,'-o',picker=5, lw=2,
         markersize=9, mfc="None")
       (Also, since upgrading, now I have a number of things that have changed/are not working in my app, will have to change, but that's probably for the better since I know there are some nice new features in mpl)

Any ideas?

Thanks,
Che

>
> C M wrote:
>>
>> Sorry this is a basic question but I can't figure out where
>> in the docs nor archives I could find this.
>>
>> Is there a built in method for having unfilled markers?
>> (ones that match the line color).
>>
>> I could set mfc (marker face color) to white and
>> mec (marker edge color) to the color of my line, but
>> what if I don't know the color (because it is generated
>> through the mpl color cycler)?
>>
>> Thanks.
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by:
>> SourcForge Community
>> SourceForge wants to tell your story.
>> http://p.sf.net/sfu/sf-spreadtheword
>> _______________________________________________
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net <mailto:Matplotlib-users@lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>> >
>

------------------------------------------------------------------------

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Norbert,

It did, thank you! One question, though: when I originally tried something like this, it didn’t work, because it was treating pl as a list and giving me the error of

“list object has no attribute ‘set_mec()’” Why does the addition of the comma to pl allow it to see it as a line?

···

On Sun, Jan 25, 2009 at 6:44 PM, Norbert Nemec <Norbert.Nemec.list@…380…> wrote:

Sorry for my misleading words - I did not correctly recall my own work from back then…

In fact, the code as it is does not change the mec automatically when the mfc of a filled_marker is set to “None” but leaves it black. I did consider adding an automation to change but decided against it. The logic would have become too complex and hard to predict.

What you can do is setting the mec afterwards using get_color on the plot like

pl, = plot(x,y,"-o",mfc=“None”)

pl.set_mec(pl.get_color())

Hope that helps?

Norbert,

It did, thank you! One question, though: when I originally tried
something like this, it didn't work, because it was treating pl as a list
and giving me the error of
"list object has no attribute 'set_mec()'" Why does the addition of the
comma to pl allow it to see it as a line?

You can draw multiple lines with a single plot command and
plot() returns a "list" of lines that were added.
In this case, the return value is a list of a single line, which is
unpacked with the comma .
Regards,

-JJ

Has the mec always been black? I thought it used to be the same as the line colour. I expected it to default to the line colour, as Che expected.

Gary R.

Norbert Nemec wrote:

···

Sorry for my misleading words - I did not correctly recall my own work from back then...

In fact, the code as it is does not change the mec automatically when the mfc of a filled_marker is set to "None" but leaves it black. I did consider adding an automation to change but decided against it. The logic would have become too complex and hard to predict.

What you can do is setting the mec afterwards using get_color on the plot like

    pl, = plot(x,y,"-o",mfc="None")
    pl.set_mec(pl.get_color())

Hope that helps?

Greetings,
Norbert

It's been this way since at least 2004:

  http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/init.py?revision=540&view=markup

JDH

···

On Mon, Jan 26, 2009 at 6:17 AM, Gary Ruben <gruben@...636...> wrote:

Has the mec always been black? I thought it used to be the same as the
line colour. I expected it to default to the line colour, as Che expected.

Thanks John,

That shows how long it is since I used line markers in my plots. Because I use them so infrequently, I'm probably not the best one to suggest it, but I think it would be nicer for the default colour to match the line colour by default, or for an option to be added to allow its simple selection without users having to search through the mailing list to find Norbert's solution. If I was publishing a colour plot with line markers I would definitely want to do this.

Gary

John Hunter wrote:

···

On Mon, Jan 26, 2009 at 6:17 AM, Gary Ruben wrote:

Has the mec always been black? I thought it used to be the same as the
line colour. I expected it to default to the line colour, as Che expected.

It's been this way since at least 2004:

  http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/init.py?revision=540&view=markup

JDH

Before my work in 2004, the colors were not following the line color at all, which was clearly bad behavior.

Now, there are two categories: filled markers (with edge color black and filling following the line color) and non-filled markers (with edge color following line color).

The black edge of filled markers is a matter of style which I personally like and would not want to change.

The thing that was up for dispute was only about what the edge color of filled markers should do when the filling is switched off. I see three ways to solve this:

a) Leave it black. (current behavior)
b) Switch mec to line color if mfc is either "none" or "white".
c) Switch mec to line color if mfc is not "auto"

b) or c) might be what people would expect and prefer, but I feared that it would be one step too many in built-in intelligence. But then - maybe c) would be ok? After all, switching from c) to a) by an explicit mec="k" is simple and obvious, the other way around takes a bit more.

Greetings,
Norbert

Gary Ruben wrote:

···

Thanks John,

That shows how long it is since I used line markers in my plots. Because I use them so infrequently, I'm probably not the best one to suggest it, but I think it would be nicer for the default colour to match the line colour by default, or for an option to be added to allow its simple selection without users having to search through the mailing list to find Norbert's solution. If I was publishing a colour plot with line markers I would definitely want to do this.

Gary

John Hunter wrote:
  

On Mon, Jan 26, 2009 at 6:17 AM, Gary Ruben wrote:
    

Has the mec always been black? I thought it used to be the same as the
line colour. I expected it to default to the line colour, as Che expected.
      

It's been this way since at least 2004:

  http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/init.py?revision=540&view=markup

JDH
    
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Hi Norbert,

Both of your proposals (b) and (c) sound better to me than the current behaviour, although they don't sound as obvious to me as simply defaulting to always setting the mec to the line colour unless overridden using mec="k" - you could label this proposal (d).

Since others seem to have been happy with the black edges and I don't know how much extra logic (and consequently extra overhead) is required to change to (d), I'd be easily persuaded that (b) or (c) would be OK since, as you say, the black edge of filled markers is a matter of style preference and if black edges are not wanted on a particular plot that uses filled markers, the edge width can simply be set to zero. The decision might be guided by whichever results in the simplest logic or least overhead.

regards,
Gary

Norbert Nemec wrote:

···

Before my work in 2004, the colors were not following the line color at all, which was clearly bad behavior.

Now, there are two categories: filled markers (with edge color black and filling following the line color) and non-filled markers (with edge color following line color).

The black edge of filled markers is a matter of style which I personally like and would not want to change.

The thing that was up for dispute was only about what the edge color of filled markers should do when the filling is switched off. I see three ways to solve this:

a) Leave it black. (current behavior)
b) Switch mec to line color if mfc is either "none" or "white".
c) Switch mec to line color if mfc is not "auto"

b) or c) might be what people would expect and prefer, but I feared that it would be one step too many in built-in intelligence. But then - maybe c) would be ok? After all, switching from c) to a) by an explicit mec="k" is simple and obvious, the other way around takes a bit more.

Greetings,
Norbert

Norbert Nemec wrote:

Before my work in 2004, the colors were not following the line color at all, which was clearly bad behavior.

Now, there are two categories: filled markers (with edge color black and filling following the line color) and non-filled markers (with edge color following line color).

The black edge of filled markers is a matter of style which I personally like and would not want to change.

The thing that was up for dispute was only about what the edge color of filled markers should do when the filling is switched off. I see three ways to solve this:

a) Leave it black. (current behavior)
b) Switch mec to line color if mfc is either "none" or "white".
c) Switch mec to line color if mfc is not "auto"

For (b), please don't consider "white" as equivalent to "none"--they are completely different. The most logical thing, with minimum surprise and maximum ease of use, *might* be to consider filled markers with the filling turned off as exactly equivalent to unfilled markers. Setting mfc to "none" is what turns off the filling.

I don't see any docstring explanation of the "auto" settings.

Eric

···

b) or c) might be what people would expect and prefer, but I feared that it would be one step too many in built-in intelligence. But then - maybe c) would be ok? After all, switching from c) to a) by an explicit mec="k" is simple and obvious, the other way around takes a bit more.

Greetings,
Norbert

Gary Ruben wrote:

Thanks John,

That shows how long it is since I used line markers in my plots. Because I use them so infrequently, I'm probably not the best one to suggest it, but I think it would be nicer for the default colour to match the line colour by default, or for an option to be added to allow its simple selection without users having to search through the mailing list to find Norbert's solution. If I was publishing a colour plot with line markers I would definitely want to do this.

Gary

John Hunter wrote:
  

On Mon, Jan 26, 2009 at 6:17 AM, Gary Ruben wrote:
    

Has the mec always been black? I thought it used to be the same as the
line colour. I expected it to default to the line colour, as Che expected.
      

It's been this way since at least 2004:

  http://matplotlib.svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/lib/matplotlib/init.py?revision=540&view=markup

JDH
    
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

It just occurred to me that another option might be to simply add a new colour option "line" for mec and mfc which would instruct them to pick up the current line colour.

Gary

As a slightly off-topic question, is there a reason that the argument is the string 'none' instead of a normal python None?

-Rob

···

On Jan 27, 2009, at 1:02 PM, Eric Firing wrote:

Setting
mfc to "none" is what turns off the filling.

----
Rob Hetland, Associate Professor
Dept. of Oceanography, Texas A&M University
http://pong.tamu.edu/~rob
phone: 979-458-0096, fax: 979-845-6331

None means use the rc param, so it is overloaded here. Not
particularly elegant, but None was already in use for all the line
properties and we needed some way to specify unfilled.

···

On Wed, Jan 28, 2009 at 9:42 AM, Rob Hetland <hetland@...760...> wrote:

On Jan 27, 2009, at 1:02 PM, Eric Firing wrote:

Setting
mfc to "none" is what turns off the filling.

As a slightly off-topic question, is there a reason that the argument
is the string 'none' instead of a normal python None?