Skip to content
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

[FEATURE] Split/allow to split legend of overlay in Bokeh #4580

Open
erezinman opened this issue Aug 31, 2020 · 0 comments
Open

[FEATURE] Split/allow to split legend of overlay in Bokeh #4580

erezinman opened this issue Aug 31, 2020 · 0 comments

Comments

@erezinman
Copy link

Related Issues

It is related to the inability to have multiple-columns in a bokeh legend (#4529).

The Suggestion

I've seen that Overlay has a multiple_legends parameter that I was unable to use properly. I think that a good utilization of this property that also applies to the above issue is to allow different legends for "underlying" overlays to be separate when this option is applied. For example, to allow something like the following:

overlay_1 = (hv.Curve([1, 2, 3], label='A') * hv.Curve([3, 2, 1], label='B')).opts(legend_position='bottom_right')
overlay_2 = (hv.Curve([1, 3, 2], label='C') * hv.Curve([2, 3, 1], label='D')).opts(legend_position='top_left')
overlay = (overlay_1 * overlay_2).opts(multiple_legends=True)

# ----> A plot with 4 graphs and two legends - ['A', 'B'] @ the bottom-right point, and ['C', 'D'] @ the top-left point.

Going into the legend-creation code in bokeh/element.py, it seems that the infrastructure is already there - at least for the case when both legends are placed alongside each other.

Also, in the case when legend_cols=int (as in the above issue), the LegendItems of the original legend could be split equally into the number of columns, and placed alongside eachother - similar to the suggested multiple_legends option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant