One window and two plots using command plot3
Show older comments
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 Comments
darova
on 30 Aug 2019
Why are you clearing this up?
set(gca,'xticklabel',{[]})
Indira
on 4 Sep 2019
darova
on 4 Sep 2019
Can you attach your whole code and data?
Indira
on 4 Sep 2019
darova
on 4 Sep 2019
You want them to have the same size?

Indira
on 4 Sep 2019
Indira
on 4 Sep 2019
darova
on 4 Sep 2019
I don't understand. They doesn't look at the same x axis?

Maybe you can show on the image what are you trying to do?
Indira
on 4 Sep 2019
darova
on 4 Sep 2019
Can you show on the image what do you want?
Indira
on 4 Sep 2019
Jan
on 4 Sep 2019
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?
Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
