# How can I colour my delaunay triangulation based on concentration of some property?

13 views (last 30 days)
Mark on 8 Dec 2015
Commented: Mark on 12 Dec 2015
I have a delaunay triangulation and I would like to display the increasing concentration of a property through the cells of the triangulation using the increasing intensity of a specified colour.
Please can anyone help with how to do this?
Thank you,

#### 1 Comment

Mark on 10 Dec 2015
Please can anyone help with this???

Walter Roberson on 10 Dec 2015
One way:
That is, use your triangulation to interpolate the value at a set of points.
Once you have the value, to express intensity of the color, use
target_color = [240, 18, 152]; %for example
cmap = linspace(0,1,256).' * target_color; %matrix multiply
and define the intensity that is to map to the bottom and the intensity that is to map to the top:
minintens = -85.32; %whatever appropriate
maxintens = 148139.2; %whatever appropriate
and now that you have the map, graph the intensity such as with
image(ArrayOfIntensities, [minintens, maxintens]);
colormap(cmap);

Walter Roberson on 11 Dec 2015
For something like that I would interpolate the triangulation over a grid.
However, I need to know which delaunay triangulation method you used, delaunay() or delaunayTriangulation() or DelaunayTri(), and I need to know which MATLAB version you use; also I need to know whether the point is to get it working now or to have something that is going to continue to work in MATLAB (because the easiest approaches are marked as going away soon.) Also, is it important that you stay with the particular delaunay triangulation method you are using now? Is it important that you stick with explicit delaunay triangulation method ?
Mark on 11 Dec 2015
I used delaunayTriangulation() method, and I need it to work now to start with and then I can figure out later how to make it work for the longer term. Yes the delaunay triangulation method makes it easy for me to incorporate my fracture elements into the simulation domain. Plus my code is complete using the delaunayTriangulation() method, I just now need to visually display how the concentration of water propagates through by changing color intensity.
Mark on 12 Dec 2015
Hello Walter, any luck with how to do this?
Thank you,