-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Adding rcParams[‘scatter.edgecolors’] defaulting to ‘face’ #12992
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
Adding rcParams[‘scatter.edgecolors’] defaulting to ‘face’ #12992
Conversation
Thanks for the PR. This issue was also brought up in #11933. I'm not quite sure if we want extra rcParams for every plot type. But you are right, as of now it's possible to influence the edgecolor of the markers with rcParams. It's all a bit of a mess, e.g. linewidths defaults to Please update the file |
lib/matplotlib/axes/_axes.py
Outdated
@@ -4247,13 +4247,16 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, | |||
is 'face'. You may want to change this as well. | |||
If *None*, defaults to rcParams ``lines.linewidth``. | |||
|
|||
edgecolors : color or sequence of color, optional, default: 'face' | |||
edgecolors : {'face', 'none', *None*} or color, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please also leave the "sequence of colors" in. You can do:
plt.scatter([0, 1, 2], [1, 3, 2], s=400, marker='o', edgecolors=['c', 'm', 'y'])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had issues with the line width here, not sure how nicely the new version would render in the API docs summary.
lib/matplotlib/axes/_axes.py
Outdated
@@ -4247,12 +4247,16 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, | |||
is 'face'. You may want to change this as well. | |||
If *None*, defaults to rcParams ``lines.linewidth``. | |||
|
|||
edgecolors : color or sequence of color, optional, default: 'face' | |||
edgecolors : {'face', 'none', *None*} or color or sequence of color, | |||
optional. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work because the definition has to be on a logical line.
Use a line continuation
edgecolors : {'face', 'none', *None*} or color or sequence of color, \
optional
The edge color of the marker. Possible values:
ced69df
to
fbc7cbd
Compare
Co-Authored-By: bsipocz <b.sipocz@gmail.com>
Thanks and congratulations on your first contribution to matplotlib! Hope to see you back some time. |
PR Summary
This PR attempts to add
scatter.edgecolors
to the rcParams as per a recent discussion on gitter.I would like to set edgecolors for scatter plots centrally so my plots will be more consistent without adding the kwarg to each of them (the original plots relied on the old style having a default edgecolor that is different from facecolor).
I couldn't find an rcParam that set it and was suggested to use
_internal.classic_mode
as a workaround.I haven't yet figured out where the default list is generated for testing, and thought it better ask for help there. Also, please advise whether this needs more docs beyond the change in the docstring. Also, if needed, I can go though the other functions to find use cases for the new rcParam, e.g. I suppose hexbin could also use it.
PR Checklist