Multiple 2D plots in 1 3D plot
조회 수: 8 (최근 30일)
이전 댓글 표시
I have 3 sets of data accross 3 days. In the y direction would be day 1, 2, 3. The x-direction has specific times t. while the Z direction is the intesitiy at time t. No equations just 3 sets of data with time t. See below for example of the data.
t is the time. BY is day 1's intensities, CY is day 2's intensities, and DY is day 3's intensities.
In the end I want the data to look like the example from orgin attached as a figure.
Thank you, I have tried many different things but cannot quite figure out how to get plot3 to work out.
t=[1
2
3
4
5
6
7
8
9];
BY = [4925
4564
4356
4245
3701
3662.5
3510.5
3520.5
3342];
CY = [4865.875
4657.5
4474
4221.5
4079.75
3907
3700.5
3579.25
3460.375];
DY = [421.125
416.625
446.25
423.875
429.25
398.75
379.875
374.5
357.25
340
343.25
338.625];
댓글 수: 2
채택된 답변
dpb
2021년 2월 22일
Well, your data look nothing at all like those in the sample plot and your vectors aren't of commensurate lengths, but--
plot3(t,ones(numel(t),2).*[0 1],[BY,CY]);
grid on
t1=1:numel(DY);t1=t1.';
hold on
plot3(t1,ones(size(t1)).*[2],[DY])
ylim([-0.5 2.5])
yticks(0:2)
set(gca,'YTickLabel',num2str([0:2].','Day %d'))
results in
It takes rotating around to get the orientation from default and will need cleaning up, but that's the basis to get the data on a 3D grid.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Visual Exploration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!