Shadow on xy plane of line in plot3?

17 Ansichten (letzte 30 Tage)
Andrew
Andrew am 15 Sep. 2020
Bearbeitet: Adam Danz am 15 Mär. 2021
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])

Akzeptierte Antwort

Adam Danz
Adam Danz am 19 Sep. 2020
Bearbeitet: Adam Danz am 15 Mär. 2021
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);

Weitere Antworten (1)

Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam am 16 Sep. 2020
use surfc function but you need a grid in x and y directions

Kategorien

Mehr zu Contour Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by