The colors of 3d plot surfaces do not match the Colorbar

조회 수: 3 (최근 30일)
Christian Brembilla
Christian Brembilla 2017년 4월 12일
답변: Fei Deng 2017년 4월 17일
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

답변 (1개)

Fei Deng
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.

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by