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

color option does not work #3559

Closed
Yura52 opened this issue Mar 16, 2019 · 6 comments
Closed

color option does not work #3559

Yura52 opened this issue Mar 16, 2019 · 6 comments
Labels
type: bug Something isn't correct or isn't working

Comments

@Yura52
Copy link
Contributor

Yura52 commented Mar 16, 2019

Hi! The code below produces two plots colored in the default blue. Am I missing something?

# cell 0
import holoviews as hv
import numpy as np
from holoviews import opts as ho
hv.extension('bokeh')

# cell 1
hv.Distribution(np.arange(100)).opts(color='green')

# cell 2
hv.Distribution(np.arange(100)).opts(ho.Distribution(color='green'))

macOS: 10.14.3
HoloViews: 1.11.3
NumPy: 1.16.2
Bokeh: 1.0.4
JupyterLab: 0.35.4

@ea42gh
Copy link
Contributor

ea42gh commented Mar 16, 2019

Try
hv.Distribution(np.arange(100)).opts(fill_color='green', line_color='red')

@jbednar
Copy link
Member

jbednar commented Mar 16, 2019

Usually 'color' is an alias for setting both the fill and line colors, so I'm surprised this doesn't work.

@philippjfr
Copy link
Member

The problem here is the default definition, color only works as an alias if no explicit fill or line color are specified but since the default defines both it ends up having no effect:

options.Distribution = Options(
    'style', fill_color=Cycle(), line_color='black', fill_alpha=0.5,
    muted_alpha=0.2
)

There are a number such issues which should be addressed. In this case I would suggest changing fill_color=Cycle() to color=Cycle(). This will make sure that color will work as an alias for fill_color.

@Yura52
Copy link
Contributor Author

Yura52 commented Mar 16, 2019

I got it. Thank you all for the answers!

@Yura52 Yura52 closed this as completed Mar 16, 2019
@philippjfr philippjfr reopened this Mar 16, 2019
@philippjfr
Copy link
Member

Thanks for closing, but this is definitely a bug and should be fixed.

@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Mar 16, 2019
@philippjfr philippjfr added this to the v1.12.0 milestone Mar 22, 2019
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

No branches or pull requests

4 participants