How to add contour plot to xz and yz surface to 3d plot

Hello All,
I have a 3d plot created with surfc.
I want to create contour lines on the xz and yz surface of the backround also.
How can i do it? I attached my 3d data.
Thanks for advance.

 採用された回答

Star Strider
Star Strider 2022 年 3 月 12 日

0 投票

I am not certain what the desired result is.
Try this —
LD = load('matlab.mat');
figure
surf(LD.x, LD.y, LD.V0)
hold on
contour3(LD.x, LD.y, LD.V0, '-r', 'LineWidth',1)
hold off
grid on
xlabel('x')
ylabel('y')
zlabel('V_0')
.

5 件のコメント

Özgür Alaydin
Özgür Alaydin 2022 年 3 月 12 日
Hello,
Thanks for answer but i want contours on the walls corresponding to xz and yz planes of the plot.
As given below.
Star Strider
Star Strider 2022 年 3 月 12 日
Are the contours I already plotted to be projected onto the ‘Energy’ axis instead of onto the surface itself? That would be relatively straightforward, and would simply be a series of horizontal lines on each axis.
Özgür Alaydin
Özgür Alaydin 2022 年 3 月 12 日
Yes, that is true. Should be projected onto Energy axis.
Özgür Alaydin
Özgür Alaydin 2022 年 3 月 12 日
編集済み: Özgür Alaydin 2022 年 3 月 12 日
Problem is solved.
plot3(X*1e9, My/2*ones(size(Y))*1E9, V0*1000, 'LineWidth', 1.5,'color',[0.4 1 0.4]);
plot3(-Mx/2*ones(size(X))*1E9, Y*1e9, V0*1000, 'LineWidth', 1.5,'color',[0.4 1 0.4]);
%%% mesh plotting is also working.
Thanks for help
Star Strider
Star Strider 2022 年 3 月 12 日
As always, my pleasure!
(I do not understand the variables referred to in your previous Comment. I assume the plot3 calls draw the contour levels on the axes, or with respect to mesh, draw planes through them.)

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by