Shadow on xy plane of line in plot3?

조회 수: 18 (최근 30일)
Andrew
Andrew 2020년 9월 15일
편집: Adam Danz 2021년 3월 15일
How I could plot the shadow line on xy plane for this line in plot3?
clear
close all
clc
format long
V1=1;
p1=10*10^5;
n=1.322;
V2=2;
p2=(p1*V1^n)/(V2^n);
V=V1:.01:V2;
P=(p1*V1^n)./(V.^n);
W=(p1*V1-P.*V)./(n-1);
plot3(V,P,W)
grid on
view([-19 55])

채택된 답변

Adam Danz
Adam Danz 2020년 9월 19일
편집: Adam Danz 2021년 3월 15일
To project the 3D line onto each pair of 2D axes, set the axis limits first and then use the min or max axis limits depending on your view angle.
Add this to your code.
xlim(xlim)
ylim(ylim)
zlim(zlim)
hold on
shadeColor = [.85,.85,.85];
plot3(V,P,min(zlim).*ones(size(V)),'-','Color',shadeColor,'LineWidth',2);
plot3(V,max(ylim).*ones(size(V)),W,'-','Color',shadeColor,'LineWidth',2);
plot3(max(xlim).*ones(size(P)),P,W,'-','Color',shadeColor,'LineWidth',2);

추가 답변 (1개)

Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam 2020년 9월 16일
use surfc function but you need a grid in x and y directions

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by