Skip to content

Relationship between line-art markers and the markeredgewidth parameter #4679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mwaskom opened this issue Jul 13, 2015 · 4 comments
Closed
Assignees
Milestone

Comments

@mwaskom
Copy link

mwaskom commented Jul 13, 2015

This issue is related to the call for style overhaul proposals.

My understanding of how line-art markers get drawn (e.g. "x") is that the width of the line reads from the markeredgewidth parameter.

This means that when markeredgewidth is 0, line art markers are invisible. This is particularly a problem for seaborn (where markeredgewidth is 0 by default), but I think one could argue that it is not ideal in any case.

IMO, it would be better to have some differentiation between the width of the edge around a solid marker, which is purely aesthetic, and the weight of the line that is used to draw a line-art marker, which isn't. This distinction already exists a little bit in that line-art markers are colored with the color parameter and not the markeredgecolor parameter (though specifying the latter does appear to override the former). So I would propose one of two things: 1) adding a lines.lineartwidth (or something) parameter to allow separate specification of the line-art marker width, or 2) reading from lines.linewidth instead of lines.markeredgewidth.

A related (but possibly separate; I can make a new issue) point is that it would be nice to have some "hollow" markers, like a hollow "o" or "s" which are really line-art markers with the same basic shape as a circle or square, but without a fill and where the line color is derived from color and not markeredgecolor. It's possible to draw one of these currently, but you have to do something like plt.plot(x, y, "o", markeredgewidth=1, markerfacecolor="none", markeredgecolor="b"). This means it is hard to use this style of marker through an abstract interface (i.e. seaborn), which is a shame because this can be a very useful way to draw scatterplot points.

@mwaskom
Copy link
Author

mwaskom commented Jul 13, 2015

Also I should say that my examples are about plt.plot but apply to plt.scatter too.

@WeatherGod
Copy link
Member

This actually touches on some very messy code in the deep underbelly of
matplotlib. The relationships between the different properties across the
different aspects of an Artist has been developed in an ad hoc manner. One
thing that we should keep in mind as we adopt the v2.0 styles is that some
choices can be made that will allow us to completely revamp how properties
are set, breaking from the classic style and fixing bugs along the way. I
suspect several of the nuances that you are pointing out are actually
inadvertent "bugs" in the code that has simply become our classic style.

On Mon, Jul 13, 2015 at 12:06 PM, Michael Waskom notifications@github.com
wrote:

Also I should say that my examples are about plt.plot but apply to
plt.scatter too.


Reply to this email directly or view it on GitHub
#4679 (comment)
.

@tacaswell tacaswell added this to the Color overhaul milestone Jul 14, 2015
@mdboom mdboom modified the milestones: Color overhaul, next major release (2.0) Oct 8, 2015
@mdboom
Copy link
Member

mdboom commented Nov 9, 2015

I actually this will be fairly easy to address. Markers already have "filled" in their metadata. It's just a matter of using the inputs differently under those modes.

@mdboom mdboom self-assigned this Nov 9, 2015
tacaswell added a commit to tacaswell/matplotlib that referenced this issue Nov 9, 2015
 - for plot, the default marker edge is now the color of the marker
 - for scatter the marker edge color now follows the face color

closes matplotlib#4679
mdboom pushed a commit to mdboom/matplotlib that referenced this issue Nov 11, 2015
 - for plot, the default marker edge is now the color of the marker
 - for scatter the marker edge color now follows the face color

closes matplotlib#4679
mdboom pushed a commit to mdboom/matplotlib that referenced this issue Nov 16, 2015
 - for plot, the default marker edge is now the color of the marker
 - for scatter the marker edge color now follows the face color

closes matplotlib#4679
mdboom pushed a commit to mdboom/matplotlib that referenced this issue Nov 16, 2015
 - for plot, the default marker edge is now the color of the marker
 - for scatter the marker edge color now follows the face color

closes matplotlib#4679
mdboom pushed a commit to mdboom/matplotlib that referenced this issue Nov 17, 2015
 - for plot, the default marker edge is now the color of the marker
 - for scatter the marker edge color now follows the face color

closes matplotlib#4679
mdboom pushed a commit to mdboom/matplotlib that referenced this issue Nov 23, 2015
 - for plot, the default marker edge is now the color of the marker
 - for scatter the marker edge color now follows the face color

closes matplotlib#4679
mdboom pushed a commit to mdboom/matplotlib that referenced this issue Nov 25, 2015
 - for plot, the default marker edge is now the color of the marker
 - for scatter the marker edge color now follows the face color

closes matplotlib#4679
mdboom pushed a commit to mdboom/matplotlib that referenced this issue Nov 27, 2015
 - for plot, the default marker edge is now the color of the marker
 - for scatter the marker edge color now follows the face color

closes matplotlib#4679
mdboom pushed a commit to mdboom/matplotlib that referenced this issue Nov 27, 2015
 - for plot, the default marker edge is now the color of the marker
 - for scatter the marker edge color now follows the face color

closes matplotlib#4679
@naught101
Copy link

@mwaskom: Why is markeredgewidth 0 and not markeredgecolor='none'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants