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

NdOverlay graph colors disappear for "show_legend=False" for Scatter graphs. #6205

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

Comments

@BMM3
Copy link

BMM3 commented Apr 23, 2024

ALL software version info

holoviews: 1.18.3
pandas: 2.2.1
bokeh: 3.4.0

Description of expected behavior and the observed behavior

An NdOverlay with a different color for each Scatter graph only gives the color to the Scatter graph when the legend is present. When the legend is not shown (show_legend=False), the colors are the same for all the graphs.

Notice: for the Curve graphs this is working as expected.

Notice: when the "show_legend" is disabled at the "Scatter" level it is working as expected.

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

import holoviews as hv

# The first NdOverlay with multiple Curves does work as expected
plot1_curve = hv.Curve([1, 2, 3]).opts(color='blue')
plot2_curve = hv.Curve([1, 4, 9]).opts(color='red')

ndoverlay_curve = hv.NdOverlay({0: plot1_curve, 1: plot2_curve}, 'Plot')
ndoverlay_curve.opts(show_legend=False)

# The second NdOverlay with multiple Scatters does NOT work as expected
plot1_scatter = hv.Scatter([1, 2, 3]).opts(color='blue')
plot2_scatter = hv.Scatter([1, 4, 9]).opts(color='red')

ndoverlay_scatter = hv.NdOverlay({0: plot1_scatter, 1: plot2_scatter}, 'Plot')
ndoverlay_scatter.opts(show_legend=False)

# The third NdOverlay with multiple Scatters where the show_legend option is disabled at the Scatter level does again work as 
 expected.
ndoverlay_scatter_2 = hv.NdOverlay({0: plot1_scatter, 1: plot2_scatter}, 'Plot')
ndoverlay_scatter_2.opts(hv.opts.Scatter(show_legend=False))

Screenshots or screencasts of the bug in action

image

@hoxbro hoxbro added the type: bug Something isn't correct or isn't working label Apr 23, 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