Shadow on xy plane of line in plot3?
17 views (last 30 days)
Show older comments
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])
0 Comments
Accepted Answer
Adam Danz
on 19 Sep 2020
Edited: Adam Danz
on 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);
0 Comments
More Answers (1)
Asad (Mehrzad) Khoddam
on 16 Sep 2020
use surfc function but you need a grid in x and y directions
0 Comments
See Also
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!