Use discrete colorbars for contours and polygons
See original GitHub issueIf I take the simple contour example from the docs and add a filled=True
option, the %%opts
seem to have no effect. I can no longer change the cmap or add a colorbar:
%%opts Contours [show_legend=False colorbar=True width=325] (cmap='fire')
x,y = np.mgrid[-50:51, -50:51] * 0.05
img = hv.Image(np.sin(x**2+y**3))
z0, z1 = img.range('z')
hv.operation.contours(img, levels=np.linspace(z0, z1, 5), overlaid=False, filled=True)
Holoviews version is 1.8.3-x-ga66181c36 via conda-forge.
Possibly related to #1558
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Use discrete colorbars for contours and polygons · Issue #1856
My only comment would be that, with contour plots with discrete levels, we like to see discrete colorbars. This helps to read the...
Read more >mayavi mapping a discrete colorbar on a surface
I have found my answer by using a scipy nearest-neighbour interpolation and using one color by cell of my object. from mayavi import...
Read more >Colorbars - L3HarrisGeospatial.com
You can display a colorbar that matches discrete contour levels. ... 'Discrete Colorbar Example') ; Display the second function using the original color...
Read more >Change interval of color bar in contour scatter plot - MathWorks
If you only want n discrete colors you can use any of the colormap functions and specify the number of levels. Theme.
Read more >Contourf Demo — Matplotlib 3.6.2 documentation
We are using automatic selection of contour levels; this is usually not such a good idea, because they don't occur on nice boundaries,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We now support a
color_levels
argument for discrete color mapping.Great work!
My only comment would be that, with contour plots with discrete levels, we like to see discrete colorbars. This helps to read the precise values from the plot.
In matplotlib it looks like this: