-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Inconsistent edges of half-filled markers #14357
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
Comments
Here's a full list:
I think I found a solution to the problem, although it may be running into an Agg bug :( See the new definition of set_diamond in #19354; now we just need to do the same for all other markers, and perhaps figure out the Agg bug... (https://svgwg.org/svg2-draft/painting.html#TermLineJoinShape may be relevant too.) |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
Bug report
Bug summary
The edges of some half-filled markers either produce spikes or are missing parts.
Code for reproduction
This code produces the following image

Expected output
The outer marker edges should build a rectangle like for fully filled markers. The spikes and missing parts of the edge are not as noticeable for the default marker size (left), but they can still be visible when printed from a vector image (e.g. pdf). (The transparency of the edges is just to more clearly show the two paths the marker edge is composed of.)
When looking into the
matplotlib.markers.MarkerStyle._set_diamond
method, there are three issues generating this output:'miter'
, which causes the spikes at the top since the corner has a very sharp 45° angle.'butt'
. At the marker bottom the edge path starts and ends and does not complete the corner.The same issue appears for the other half-filled styles
'left'
,'top'
and'bottom'
(since they only rotate the marker differently). Other markers have similar issues (e.g.'s'
,'^'
,'d'
,'h'
).My current solution is to set the join-style and cap-style to
'rounded'
at the end of theMarkerStyle._set_diamond
methodThis produces the output

The corners are now round instead of pointy, but the spikes and missing parts are gone and the marker is symmetric.
A more general solution would be better, though. This would maybe require using custom paths for the edges instead of reusing the paths of the marker faces. But I'm not sure whether this can be easily implemented.
Matplotlib version
The text was updated successfully, but these errors were encountered: