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

Allow defining color intervals #2797

Merged
merged 5 commits into from
Jun 13, 2018
Merged

Allow defining color intervals #2797

merged 5 commits into from
Jun 13, 2018

Conversation

philippjfr
Copy link
Member

This PR adds support for defining color intervals via the color_levels option. The color_levels option now allows defining a list of levels to map each supplied color to.

The example used in the docs is as follows:

levels = [0, 38, 73, 95, 110, 130, 156, 999]  
colors = ['#5ebaff', '#00faf4', '#ffffcc', '#ffe775', '#ffc140', '#ff8f20', '#ff6060']

path = [
    (-75.1, 23.1, 0),   (-76.2, 23.8, 0),   (-76.9, 25.4, 0),   (-78.4, 26.1, 39),  (-79.6, 26.2, 39),
    (-80.3, 25.9, 39),  (-82.0, 25.1, 74),  (-83.3, 24.6, 74),  (-84.7, 24.4, 96),  (-85.9, 24.8, 111),
    (-87.7, 25.7, 111), (-89.2, 27.2, 131), (-89.6, 29.3, 156), (-89.6, 30.2, 156), (-89.1, 32.6, 131),
    (-88.0, 35.6, 111), (-85.3, 38.6, 96)
]

hv.Path([path], vdims='Wind Speed').options(
    color_index='Wind Speed', color_levels=levels, cmap=colors, line_width=8, colorbar=True, width=450
)

bokeh_plot

@philippjfr philippjfr added tag: component: plotting type: enhancement Minor feature or improvement to an existing feature labels Jun 12, 2018
@philippjfr
Copy link
Member Author

Ready to merge when tests pass.

@jlstevens
Copy link
Contributor

Looks good to me. Merging.

@jlstevens jlstevens merged commit ed3df85 into master Jun 13, 2018
@philippjfr philippjfr deleted the color_intervals branch July 4, 2018 11:12
Copy link

This pull request 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 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tag: component: plotting type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants