The colors of 3d plot surfaces do not match the Colorbar
3 views (last 30 days)
Show older comments
Hi to all, my goal is to get some color maps in 2D built up from 3 vectors. The vectors are the x,y and z coordiante of points. I already tried several other methods and I do not want to built a mesh for the coordiante Z. Therefore, I applied to the following 3 vectors:
X=[1 3 1 4 5 1];
Y=[5 4 3 5 1 4];
Z=[100 105 105 100 115 102.6];
the function trisurf.
trisurf(delaunay(X,Y),X,Y,Z)
view(2);
Unfortunatly, the color of the surfaces do not match with the Colorbar (located on the right side of the image). As you can see, the point (5,1) has Z value of 115 which matches to yellow color in the Colorbar.
Would it be possible to blur the surfaces in order to see all the colors according to the Colorbar? Best regards, Christian
0 Comments
Answers (1)
Fei Deng
on 17 Apr 2017
You are using trisurf(Tri,X,Y,Z) where color is proportional to surface height. Color of each triangle is determined by the height (averaged) of that triangle, which consists of (5,1), (4,5), and (3,4), or (5,1), (3,4) and (1,3). However you are expecting the color according to a certain point (5,1).
If you want the area close to point (5,1) painted as yellow, then you need to make more and smaller triangles, and mesh can do that.
0 Comments
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!