Setting pointColors with custom colormaps
See original GitHub issueThe results of the mesh_coloring.py example does not produce a colored man in the middle as would be expected, see image:
What I’d like to do is setting the colors per point of an polydata object based on my own colormap, so that I can define the scaling from min to max.
# myarr is a numpy float32 1D array with e.g. min=10, max = 20000
from vtkplotter import colorMap
r, g, b = colorMap(... name='jet', vmin=myarr.min(), vmax=myarr.max())
and somehow pass this to an actor:
man1.pointColors(myarr alpha=0.5, cmap=MyColormapAbove)
A working example would be very helpful.
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (10 by maintainers)
Top Results From Across the Web
Setting pointColors with custom colormaps · Issue #10 - GitHub
What I'd like to do is setting the colors per point of an polydata object based on my own colormap, so that I...
Read more >Simple steps to create custom colormaps in Python
So today I am going to show you how I usually resolve this problem by creating my custom colormap based on any image....
Read more >GGPlot Colors Best Tricks You Will Love - Datanovia
This article presents multiple great solutions you should know for changing ggplot colors. Many predefined color palettes are also provided.
Read more >Colors (ggplot2) - Cookbook for R
Sample data; Simple color assignment; Mapping variable values to colors; A colorblind-friendly palette; Color selection; Setting luminance and saturation ...
Read more >Creating Colormaps in Matplotlib
This can be done using the class ListedColormap and a Nx4 numpy array of values between 0 and 1 to represent the RGBA...
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
sorry that’s not very clear to me, do you want to set colors to cell based on edge length, or color the edges? Is the snippet already the solution? (Indeed it is a very clever one to colorize lines!)
Indeed, there was an old version hiding which got imported first. Your example works now and I can control the colormap with the vmin/vmax as I wanted. Thanks.