Merging three 3D plots into one
조회 수: 15 (최근 30일)
이전 댓글 표시
Dear community,
How can I merge three different 3D plots into one? My figures are saved in .fig (here I attach them), and I would like to plot them in the same graph to compare them. Is it possible to change the color of each of them and put a label to compare them properly? I have seen in the forum that I can apply the commands:
findobj
and
copyobj
but I don't know how they properly work.
Thanks in advance!
댓글 수: 0
채택된 답변
Dave B
2021년 10월 18일
You can copy the surfaces from each of the axes, in each of the figures that you open like this:
a=open('BandL_my_replication_variance.fig');
b=open('BandL_my_replication_variance_c2.fig');
c=open('BandL_my_replication_variance_concave.fig');
s1=findobj(a,'type','Surface');
s2=findobj(b,'type','Surface');
s3=findobj(c,'type','Surface');
ax=axes(figure);
s1=copyobj(s1,ax);
s2=copyobj(s2,ax);
s3=copyobj(s3,ax);
close([a b c])
Then you can adjust the color on those surfaces like this:
s1.FaceColor='r';
s2.FaceColor='g';
s3.FaceColor='b';
And finally pick a view that you can see them like this:
view([32 23])
(I didn't copy over the x/y/z labels or add a legend but that part should be relatively simple)
댓글 수: 3
Dave B
2021년 10월 18일
How about something like this? I used a black plane that spans the limits of the x and y axes, but a bit of transparency so we can see the stuff under 0. Not sure that will accomplish your goal of differentiating but maybe? (your example above seemed to have all positive z)
surf(xlim,ylim,zeros(2),'FaceColor','k','FaceAlpha',.2)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!