The colors of 3d plot surfaces do not match the Colorbar
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Fei Deng
2017-4-17
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!