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

Comments

@ahuang11
Copy link
Collaborator

@ahuang11 ahuang11 commented Feb 11, 2018

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

@philippjfr philippjfr commented Feb 11, 2018

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

@ahuang11 ahuang11 commented Feb 11, 2018

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 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

@ahuang11 ahuang11 commented Feb 11, 2018

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

@jlstevens jlstevens commented Feb 11, 2018

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

@ahuang11 ahuang11 commented Feb 18, 2018

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 removed this from the v2.0 milestone Mar 4, 2018
@philippjfr philippjfr added this to the v1.10 milestone Mar 4, 2018
@philippjfr philippjfr closed this Mar 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants