Shadow on xy plane of line in plot3?

21 visualizzazioni (ultimi 30 giorni)
Andrew
Andrew il 15 Set 2020
Modificato: Adam Danz il 15 Mar 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])

Risposta accettata

Adam Danz
Adam Danz il 19 Set 2020
Modificato: Adam Danz il 15 Mar 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);

Più risposte (1)

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

Categorie

Scopri di più su Contour Plots in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by