Plotting Multiple Graphs in a 3D form

조회 수: 24 (최근 30일)
Thomas Horne
Thomas Horne 2019년 4월 3일
답변: krishna teja 2020년 4월 14일
hello i am wishing to plot 5 graphs showing the relationship between
x, the time of day in hours
y, the load upon a transformer
z, the penetration on the grid
I have all my y values as vectors like so;
FEV5=[0.55
0.4
0.4
0.4
0.4
0.4
0.4
0.6
0.8
0.82
0.83
0.81
0.8
0.85
0.75
0.77
0.78
1.215
1.5
1.425
1.35
1.335
1.275
0.55
];
i want to have a 3D graph that uses the z axis as a guide to that penetration level is being shown at that point, i basicly want 5 2d plots graphed one hebind the other in a 3d mannor with a spacing of 10% between them as the penetration goes from 0%-50%

답변 (2개)

Agnish Dutta
Agnish Dutta 2019년 4월 12일
편집: Agnish Dutta 2019년 4월 12일
The dimensions of the 5 different plots must be the same for the following to work. So make sure you pre-process your data accordingly.
N = 5 ; % No. of plots.
data_size = 200 ; % Length of data to be plotted.
t = 1:data_size ; % X-coordinates of the 2D grpahs.
data = rand(N,data_size) ; % Each row contains contains data for each 2D graph.
figure
hold on
for i = 1:N
plot3(t,i*ones(size(t)),data(i,:))
end
view(3)
If you want to use custom values for 'z' :
N = 1:100:1000 ;
data_size = 200 ;
t = 1:data_size ;
data = rand(length(N),data_size) ;
figure
hold on
for i = 1:length(N)
plot3(t,N(i)*ones(size(t)),data(i,:))
end
view(3)
  댓글 수: 1
kc
kc 2020년 1월 23일
How to put markers on each of plot and different colors as given belowCapture3d.JPG. Plz guide

댓글을 달려면 로그인하십시오.


krishna teja
krishna teja 2020년 4월 14일
use waterfall command.
customisations available for it

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by