-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: Using "." as markers create wrong-sized legend_elements for scatter plot #21848
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
They are probably coming out wrong because your dpi changes. '.' attempts to fill in a pixel, but pixels are sneaky and change their size. Better to not use '.' if you care about exact sizes. |
I'm not actually sure what But even if it's supposed to fill in a certain number of pixels, shouldn't those numbers of pixels be the same in the legend and the plot? |
I'm not sure this is specific to |
I think that 'o' is an optical illusion - it looks fine when you line them up. The problem here is the peculiarity of how |
Should we then disallow |
Perhaps some relevant context here on how the concept of "marker size" across different marker shapes is rather complicated: #15703 |
Sure, but those markers should be consistent in the legend. The problem here is that the size gets halved for '.' but it is still a circle, so when the legend gets made, the marker is sized like it is 'o'. |
Bug summary
If Axes.scatter() is being used to create a scatter plot with
marker="."
, the legend entries created by PathCollection.legend_elements() have the wrong sizes.Code for reproduction
Actual outcome
Expected outcome
This is if setting
marker="o"
:Additional information
No response
Operating system
Linux
Matplotlib Version
3.4.3 and 3.5.0
Matplotlib Backend
QtAgg
Python version
3.9.7
Jupyter version
No response
Installation
conda
The text was updated successfully, but these errors were encountered: