You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There was a PR to set the shadow color for legend which is now closed: #18668
Proposed solution
Revive that PR. The fair thing to do is to add a Co-authored-by with the original author even if it looks like you will have to copy-and-paste the code. (If you rewrite it independently, there is of course no need to do that.)
Note that there are still some review comments left to handle.
I was thinking of reviving the linked PR, but I saw something that confused me a bit.
In a code like ax.legend(shadow="y") should "y" be interpreted as "yellow" or True (as in yes)?
More generally, in test_rcparams.py, there are some expressions (under validate_bool) that presumably should be accepted as booleans:
Is there a principled way to check if a shadow argument is one of these beyond just copy-pasting the tuple? Or is something like
if is_color_like(shadow):
...
elif shadow in ('t', 'y', 'yes', 'on', 'true', '1', 1, True):
...
elif shadow in ('f', 'n', 'no', 'off', 'false', '0', 0, False):
pass
else:
raise ValueError('shadow must be a valid color or bool')
Activity
tuncbkose commentedon Dec 8, 2022
I was thinking of reviving the linked PR, but I saw something that confused me a bit.
In a code like
ax.legend(shadow="y")should"y"be interpreted as"yellow"orTrue(as in yes)?More generally, in test_rcparams.py, there are some expressions (under
validate_bool) that presumably should be accepted as booleans:Is there a principled way to check if a
shadowargument is one of these beyond just copy-pasting the tuple? Or is something likegood enough?
oscargus commentedon Dec 8, 2022
I believe that one should differentiate between the rcparams and passing the argument to
legend.For rcparams there will indeed be a bit of a clash for
'y'and, I think, 1 and 0. Can be worthwhile noting this in the docs.For
legend=..., onlyTrue/Falseare valid, so there it shouldn't be a problem.I think the current code deals with it quite OK, but one should probably document the possible clashes somewhere and how it behaves.
anntzer commentedon Dec 8, 2022
I think deprecating the interpretation of t/f/y/n as bools in rcparams would be reasonable too.
Shikharishere commentedon Feb 17, 2023
is this issue still open? If yes I would like take it.......
tuncbkose commentedon Feb 17, 2023
There is already some work done and discussion in the linked pull request. I was hoping to finish it next week but feel free to help if you'd like.