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

hv.Cycle() does not cycle through the entire list of colors #2333

Closed
ahuang11 opened this issue Feb 11, 2018 · 6 comments
Closed

hv.Cycle() does not cycle through the entire list of colors #2333

ahuang11 opened this issue Feb 11, 2018 · 6 comments
Labels
tag: component: options type: bug Something isn't correct or isn't working type: discussion
Milestone

Comments

@ahuang11
Copy link
Collaborator

After the 5th color, it starts from the first.

color_cycle = hv.Cycle([
                   'red',
                   'yellow',
                   'orange',
                   'green',
                   'blue',
                   'gray',
                   'black',
                   'brown',
                   'purple',
                   'pink'
                   ])

%%opts Curve (line_color=color_cycle)
ds.to.curve('target', 'valid_z', ['lead']).overlay()

image

@philippjfr
Copy link
Member

I believe this is because all cycles get tied together and since there is already a Cycle on color that one defines the length. I'd be strongly in favor of changing that behavior.

@ahuang11
Copy link
Collaborator Author

A hack would be to just to double/triple the length color by repeating it. That way, the length would also be doubled/tripled without the default color list changed?

i.e if color was defined like this:

color = ['red', 'yellow',  'orange', 'green', 'blue'] * 2

Also is there a workaround for cycling through more than 5 colors?

@philippjfr
Copy link
Member

philippjfr commented Feb 11, 2018

In this case I'd just override the default color cycle like this:

%%opts Curve (color=color_cycle)
ds.to.curve('target', 'valid_z', ['lead']).overlay()

color is an alias for line_color in this case, with the latter taking precedence.

@ahuang11
Copy link
Collaborator Author

Oh, awesome; that worked. Is there a workaround for box-whisker plots?

Unexpected style option 'color' for BoxWhisker in loaded backend 'bokeh'.

@jlstevens
Copy link
Contributor

I agree..the shortest cycle shouldn't determine the length of the overall cycle. It should be the opposite and loop to match the longest cycle definition...

@ahuang11
Copy link
Collaborator Author

To answer my own question, the style options cmap works for box-whisker plots.

@jlstevens jlstevens added this to the v2.0 milestone Feb 19, 2018
@philippjfr philippjfr modified the milestones: v2.0, v1.10 Mar 4, 2018
@philippjfr philippjfr added the type: bug Something isn't correct or isn't working label Mar 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag: component: options type: bug Something isn't correct or isn't working type: discussion
Projects
None yet
Development

No branches or pull requests

3 participants