# One window and two plots using command plot3

1 ビュー (過去 30 日間)
Indira 2019 年 8 月 29 日
コメント済み: Jan 2019 年 9 月 4 日
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}'})
##### 13 件のコメント表示非表示 12 件の古いコメント
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?

サインインしてコメントする。

R2018b

### Community Treasure Hunt

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

Start Hunting!

Translated by