| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping @matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
Sorry, something went wrong.
|
Thanks for working on this! Overall 👍, but is it possible to have the default rcParam be None? Currently the default label color will fall back to the rcParams['text.color'] but with this PR will default to 'black' |
Sorry, something went wrong.
|
Sure. I think that making a little change in the lib/matplotlib/legend.py it can work. I will give it a try. |
Sorry, something went wrong.
| if labelcolor is None: | ||
| pass | ||
| elif isinstance(labelcolor, str) and labelcolor in color_getters: | ||
| if mpl.rcParams['legend.labelcolor'] != 'none': |
There was a problem hiding this comment.
The legend docstring should note that this rcparam exists....
Sorry, something went wrong.
There was a problem hiding this comment.
Should this be `
| if mpl.rcParams['legend.labelcolor'] != 'none': | |
| if mpl.rcParams['legend.labelcolor'] is not None: |
along with similar changes to validator? There are a number of places where we use the string 'none' as a color to mean "this thing does not get a color" and None (the singleton) to mean "use the default color".
That said, currently doing
... ax.legend(labelcolor='none')
does not result in an invisible label which is a bug in the implementation below (cycle of a 0 length thing is also 0 length, not infinite).
Sorry, something went wrong.
There was a problem hiding this comment.
The rcParam can't be able to both be None and 'none', though, right? The fallback version would need a special value to work, like 'auto' or 'textcolor'?
Sorry, something went wrong.
There was a problem hiding this comment.
#20225 fixes the bug I noted above!
Sorry, something went wrong.
| 'markerfacecolor' (or 'mfc'), or 'markeredgecolor' (or 'mec'). | ||
|
|
||
| Otherly, labelcolor can be set globally using :rc:`legend.labelcolor`. | ||
|
|
There was a problem hiding this comment.
Sorry to be picky, bit this should go in as
labelcolor : str or list, default: :rc:`legend.labelcolor`.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the review.
But when the rcParams[legend.labelcolor] is None(the default value(, should the docs say that it just uses the rcParams['text.color'] value?
Sorry, something went wrong.
There was a problem hiding this comment.
I think that should be specified in the description of the parameter if it is not already
Sorry, something went wrong.
There was a problem hiding this comment.
This is fine w/ me now. @tacaswell you have a block on this...
Sorry, something went wrong.
There was a problem hiding this comment.
Looks on the right path, but the default value should be None not 'none'.
Sorry, something went wrong.
| if labelcolor is None: | ||
| pass | ||
| elif isinstance(labelcolor, str) and labelcolor in color_getters: | ||
| if mpl.rcParams['legend.labelcolor'] != 'none': |
There was a problem hiding this comment.
Should this be `
| if mpl.rcParams['legend.labelcolor'] != 'none': | |
| if mpl.rcParams['legend.labelcolor'] is not None: |
along with similar changes to validator? There are a number of places where we use the string 'none' as a color to mean "this thing does not get a color" and None (the singleton) to mean "use the default color".
That said, currently doing
... ax.legend(labelcolor='none')
does not result in an invisible label which is a bug in the implementation below (cycle of a 0 length thing is also 0 length, not infinite).
Sorry, something went wrong.
|
@tacaswell you are still blocking on this.... |
Sorry, something went wrong.
|
Thanks @Carloscerq ! Congratulations on your first merged Matplotlib PR 🎉 hope we hear from you again! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
This is a proposal for a new legend rcParam.
The legend.labelcolor was proposed in #20049. It's for changing the labelcolor of all figures(similar to the labelcolor of plt.legend)
Example:
PR Checklist