フィルターのクリア

Change color of a specific line in mesh

4 ビュー (過去 30 日間)
Morteza
Morteza 2020 年 4 月 2 日
コメント済み: Star Strider 2020 年 4 月 2 日
I easily plot teh following graph:
mesh(X,Y,F,'FaceColor','none');
No I need to bold, and change the color of just one of lines in the figure! For example in specific value xi=5, we have a plane cutting the surface and it is a line graph. I want to change the color of that specific contour line graph.

採用された回答

Star Strider
Star Strider 2020 年 4 月 2 日
編集済み: Star Strider 2020 年 4 月 2 日
No exact solutions without your code and data.
One approach:
xv = -15:0.8:15;
yv = -10:0.8:10;
[X,Y] = ndgrid(xv, yv);
z = @(x,y) sin(x) + cos(y);
figure
mesh(X, Y, z(X,Y))
hold on
line_at_x = 5; % Define ‘x’ Value Of Line
plot3(line_at_x+zeros(size(yv)), yv, z(line_at_x+zeros(size(yv)), yv), '-r','LineWidth',2) % Add Line To ‘mesh’ Plot
hold off
grid on
xlabel('X')
ylabel('Y')
view(10, 10)
EDIT — (2 Apr 2020 at 14:16)
Improved code.
  2 件のコメント
Morteza
Morteza 2020 年 4 月 2 日
Thank you very much. Resolved.
Star Strider
Star Strider 2020 年 4 月 2 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by