PDA

查看完整版本 : 同一张图上的两个trisurf图具有不同的颜色


poster
2019-12-14, 20:38
我在同一张图上有两个trisurf (http://www.mathworks.com/help/techdoc/ref/trisurf.html) 。我想有一个红色和一个蓝色,但是我似乎无法使用colormap来使两个图具有不同的颜色。我怎样才能做到这一点?



回答:

figure [x,y]=meshgrid(1:15,1:15); tri = delaunay(x,y); z1 = peaks(15); th1 = trisurf(tri,x,y,z1); set(th1, 'FaceColor', 'b') hold all z2 = 0.4*peaks(15); th2 = trisurf(tri,x,y,z2); set(th2, 'FaceColor', 'r') hold off

更多&回答... (https://stackoverflow.com/questions/4582746)