how can i change color of a 3D plot?

8 ビュー (過去 30 日間)
Nikhil Murarka
Nikhil Murarka 2019 年 5 月 30 日
コメント済み: Nikhil Murarka 2019 年 6 月 4 日
I have been trying to plot a 3D curve consisting of 4 variables :3 along the three axes and the fourth one as the parameter.As i change the value of the parameter the graph changes accordingly but since the new graph's color is similar to the old one it is difficult to distinguish them..the image has D2 as a parameter. Can i change the color of the graph according to the legend function? Thanks!
  2 件のコメント
darova
darova 2019 年 5 月 30 日
Can you please attach your code and data?
Nikhil Murarka
Nikhil Murarka 2019 年 6 月 4 日
I got the answer...thanks for taking your interest in this question.

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2019 年 5 月 30 日
I am not certain what you want.
You can always experiment with the ‘CMap’ property:
[X,Y] = ndgrid((0:0.1:1));
Z1 = X/10 - Y;
Z2 = X/10 - Y + 0.2;
figure
subplot(1,2,1)
mesh(X,Y,Z1)
hold on
mesh(X,Y,Z2)
grid on
axis equal
title('Original')
subplot(1,2,2)
M1 = mesh(X,Y,Z1);
hold on
M2 = mesh(X,Y,Z2);
M2.CData = M1.CData + 3;
grid on
axis equal
title('‘CMap’ Adjusted')
This is an extreme example, however it demonstrates the effect:
how can i change color of a 3D plot - 2019 05 30.png

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by