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

Removing the legend from NdOverlay also removes the colors #6224

Open
BMM3 opened this issue May 8, 2024 · 0 comments
Open

Removing the legend from NdOverlay also removes the colors #6224

BMM3 opened this issue May 8, 2024 · 0 comments
Labels
type: bug Something isn't correct or isn't working

Comments

@BMM3
Copy link

BMM3 commented May 8, 2024

ALL software version info

holoviews: 1.18.3

Description of expected behavior and the observed behavior

I am creating a layout with multiple NdOverlays plots where each NdOverlay shows multiple colored graphs. (see example below)
When I use the option “show_legends=0” to only show 1 legend in the full layout, I see that all the plots that don’t have a legend anymore also don’t have any different colors anymore.

Notice: when I just set the “show_legend” to false for all (except for 1) plot, I do get a normal plot.

Complete, minimal, self-contained example code that reproduces the issue

df = pd.DataFrame({'x': [1,2,3], 'y': [2,3,4],})
p1a = hv.Scatter(df, kdims='x', vdims=['y']).opts(color='red', size=8)
df = pd.DataFrame({'x': [1,2,3], 'y': [5,6,7],})
p2a = hv.Scatter(df, kdims='x', vdims=['y']).opts(color='green', size=8)
pa = hv.NdOverlay({'red':p1a, 'green':p2a}, 'plots').opts(legend_position='right')
df = pd.DataFrame({'x': [1,2,3], 'y': [1,1.5,2],})
p1b = hv.Scatter(df, kdims='x', vdims=['y']).opts(color='red', size=8)
df = pd.DataFrame({'x': [1,2,3], 'y': [3,4,5],})
p2b = hv.Scatter(df, kdims='x', vdims=['y']).opts(color='green', size=8)
pb = hv.NdOverlay({'red':p1b, 'green':p2b}, 'plots').opts(legend_position='right')
p = pa+pb
p.opts(show_legends=0)

Screenshots or screencasts of the bug in action

A plot with multiple legends:
image

A plot with a single legend:
image

@ahuang11 ahuang11 added the type: bug Something isn't correct or isn't working label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

2 participants