One window and two plots using command plot3
조회 수: 1 (최근 30일)
이전 댓글 표시
I think my code is OK, but I would like to show that my plots are using the same x axis.
Here is my code:
set(gcf,'position',[pos1_graph,pos2_graph,pos3_graph,pos4a_graph])
[ha, pos] = tight_subplot(2,1,[.03 .01],[.1 .05],[.1 .05]) ;
axes(ha(1))
x0=time;
y0=1*ones(size(x0))';
z0=Inertial_cont;
x1a=[t_slp1;t_slp1(end)+0.0005];
y1a=0.6*ones(size(t_slp1)+1)';
z1a=[Inertia_slp1;0];
x2a=[t_slp2;t_slp2(end)+0.0005];
y2a=0.7*ones(size(t_slp2)+1)';
z2a=[Inertia_slp2;0];
x3a=[t_slp3;t_slp3(end)+0.0005];
y3a=0.8*ones(size(t_slp3)+1)';
z3a=[Inertia_slp3;0];
x4a=[t_slp4;t_slp4(end)+0.0005];
y4a=0.9*ones(size(t_slp4)+1)';
z4a=[Inertia_slp4;0];
plot3(x0,y0,z0)
hold on;
fill3(x1a,y1a,z1a,'r')
fill3(x2a,y2a,z2a,'m')
fill3(x3a,y3a,z3a,'y')
fill3(x4a,y4a,z4a,'g')
alpha(.4)
grid on;
view(10,40)
set(gca,'xticklabel',{[]})
zlabel('Power (MW)')
axis([4 9 0.6 1 0 40])
yticklabels({'P_{win1a}','P_{win2a}','P_{win3a}','P_{win4a}','P_{t}'})
axes(ha(2))
x0=time;
y0=1*ones(size(x0))';
z0=PMEC_inj_total;
x1a=[t_slp1;t_slp1(end)+0.0005];
y1a=0.6*ones(size(t_slp1)+1)';
z1a=[Gov_slp1;0];
x2a=[t_slp2;t_slp2(end)+0.0005];
y2a=0.7*ones(size(t_slp2)+1)';
z2a=[Gov_slp2;0];
x3a=[t_slp3;t_slp3(end)+0.0005];
y3a=0.8*ones(size(t_slp3)+1)';
z3a=[Gov_slp3;0];
x4a=[t_slp4;t_slp4(end)+0.0005];
y4a=0.9*ones(size(t_slp4)+1)';
z4a=[Gov_slp4;0];
plot3(x0,y0,z0)
hold on;
fill3(x1a,y1a,z1a,'r')
fill3(x2a,y2a,z2a,'m')
fill3(x3a,y3a,z3a,'y')
fill3(x4a,y4a,z4a,'g')
alpha(.4)
grid on;
view(10,40)
xlabel('time (s)')
zlabel('Power (MW)')
axis([4 9 0.6 1 0 40])
yticklabels({'P_{win1a}','P_{win2a}','P_{win3a}','P_{win4a}','P_{t}'})
Thanks for your kind comments.
댓글 수: 13
Jan
2019년 9월 4일
I do not understand, what you are asking for: "show that my plots are using the same x axis". Why not simply using the same x axis?
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!