-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Support "layer labels" with legend #3046
Comments
As discussed in #3101, I would really love this feature! |
I'd love this feature. One possible way (related to 3107) to achieve this could be enabling to specify custom string as a 'mapping'. Example:
Under the hood, the value would be assign to a new column of the layer data and this value would be used in legend in the standard way. Therefore, it's a shortcut for:
As custom string might be sometimes a bit ambiguous (and to avoid interference with data.columns), specific format of the new label may be needed (backticks?) This way of "layer labels" answers some of complications you've listed, e.g. how should this apear in legend (the position is chosen by user via aesthetics she picked for the label). |
Added with #3456; the proposed example now works as expected
|
It should be possible to represent a a layer in the legend, in addition to a mapping. An example usecase would be
We'd like this plot to have a legend with two entries: a red line with the label "1st degree" and a blue line with the label "2nd degree".
Complications!
Plot._update_legend_contents
, or should we separate out methods for "labeled layer" legends and mapping legends?The text was updated successfully, but these errors were encountered: