-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[ENH]: Add color argument to violinplot constructor #27298
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
I think that's reasonable - if we support violin plot then we should support passing in colors. |
I think we may want similar "facecolor"/"edgecolor"/"color(which is both)" logic from patches here. I also think that if given as a parameter, it should take precedence over the "classic mode" rc param, as you are explicitly asking for something deviating from default behavior then, and it is unexpected that it would be ignored. |
I am working on a PR. I haven't contributed to Matplotlib before, so am noting locations where updates might be desired if the PR is accepted. examples/statistics/customized_violin.py And of course the "what's new", etc. No comment needed until this finds it's way into a PR. |
Closed, moving conversation to PR #27304 |
We typically keep issues open until a pr is merged, not just opened. |
Problem
It would be nice to specify the color of a set of violin plots in the constructor, rather than doing it afterwards for each component of the violinplot. This is usually how colors are set in matplotlib, so it would be in keeping with the general schema of matplotlib.
I can set this up as a PR if people think it's useful and makes sense for the library.
Proposed solution
The current color selection is done here. It looks like this:
The proposed enhancement would look something like this, where
color
is a new key word argument with default value=None
.This could even work for a sequence of colors, but a little bit more code would have to be changed.
The text was updated successfully, but these errors were encountered: