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

Legend Formatting Issue #3780

Closed
Sravz-Solv opened this issue Jun 17, 2019 · 10 comments
Closed

Legend Formatting Issue #3780

Sravz-Solv opened this issue Jun 17, 2019 · 10 comments

Comments

@Sravz-Solv
Copy link

Capture

I am trying overlay data from about 40 different sensors in a single overlay plot. But with my current plot length and width settings, I cannot see all the entries in the legend, there by limiting all legend interactivity. Is there a way around this issue like dividing the legend into multiple columns or just ability to scroll through legend entries ?

@poplarShift
Copy link
Collaborator

Not sure if there's a nice way of doing it in pure holoviews (I could think of some ugly hacks but they'd probably be very inefficient), but this sounds like a case for panel.

@Sravz-Solv
Copy link
Author

How do you think panel would help with this issue?

@poplarShift
Copy link
Collaborator

You could build a widget to select and mute the lines you'd like.

For styling of the bokeh legend, that is likely an upstream issue, see here: bokeh/bokeh#3880

@Sravz-Solv
Copy link
Author

Sravz-Solv commented Jun 18, 2019

gotcha. Thanks for the quick response.

Quick tag along question then.. Can panel be used through pycharm or is it only compatible with jupyter notebook ?

@poplarShift
Copy link
Collaborator

poplarShift commented Jun 18, 2019

Hm, you should look for that over in the panel repo (or ask in the gitter channel), I don't know.

Also, if you would really like to try and hack something together in pure holoviews, here's a start, but the DataLink isn't working yet, don't know on the fly why not.

from holoviews.plotting.links import DataLink

obj = hv.Overlay([hv.Curve(np.random.rand(10,2), label='entry'+str(i)) for i in range(40)]).opts(
    opts.Curve(show_legend=True, width=400), opts.Overlay(show_legend=False),
)

leg = obj.clone().map(lambda x: x.iloc[:0], hv.Curve).opts(
    opts.Curve(width=200, height=800, xaxis=None, yaxis=None, show_frame=False),
    opts.Overlay(legend_position='right', show_legend=True), 
)
DataLink(obj, leg)
obj+leg

@geoHeil
Copy link

geoHeil commented Oct 26, 2020

Has this been solved? Is there a better way more than a year later? I am facing the same problem. http://holoviews.org/user_guide/Customizing_Plots.html#Legend-customization shows that:

overlay.opts(legend_muted=True, legend_cols=2)

should work. However, for me only the legend_muted is accepted. Specifying any legend_cols is not changing the layout.

@tom-andersson
Copy link

Bump. Having a similar problem as @geoHeil with the legend_cols parameter with holoviews 1.14.4. In fact, specifying any legend_cols value turns the legend into a single row. What's going on here?

@maximlt
Copy link
Member

maximlt commented Oct 23, 2022

Bokeh doesn't yet offer the possibility to control the legend layout (bokeh/bokeh#3880). For sure, as soon as this is added to Bokeh this will supported by HoloViews!

@TheoMathurin
Copy link
Contributor

I think this may be closed? Through #5669.

@hoxbro
Copy link
Member

hoxbro commented Jun 2, 2023

You are right. Thank you for reporting this 👍

@hoxbro hoxbro closed this as completed Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants