How do I set the limits on the secondary y axis?

104 Ansichten (letzte 30 Tage)
Edoardo Bologna
Edoardo Bologna am 20 Apr. 2017
Bearbeitet: Andrew Newell am 20 Apr. 2017
I would like to force my secondary Y axis to start from 0 rather than from 1.
figure('Position',[200, 200, 850, 400]);
yyaxis left
xlim([1 12])
P_8_area = area(ts,P_8,'EdgeColor','none');
P_8_area.FaceColor = ('k');
set(gca,'Color',[0.9 0.9 0.9]);
alpha(0.4)
xlabel('Time step')
ylabel('Power [kW]')
yyaxis right
Perm_1_8_plot = plot(ts,Perm_1_8,'-go','LineWidth',2);
xlabel('Time step')
ylabel('Permeate flow [m^3/h]')
hold on
yyaxis right
Perm_2_8_plot = plot(ts,Perm_2_8,'-r*','LineWidth',2);
xlabel('Time step')
ylabel('Permeate flow [m^3/h]')
yyaxis right
Perm_sw_8_plot = plot(ts,Perm_sw_8,'-b+','LineWidth',2);
xlabel('Time step')
ylabel('Permeate flow [m^3/h]')
legend([P_8_area,Perm_sw_8_plot,Perm_2_8_plot,Perm_1_8_plot],'Power',...
'Permeate flow with switching', 'Permeate flow 2 vessels','Permeate flow 1 vessel','Location','southwest')
hold off

Akzeptierte Antwort

Andrew Newell
Andrew Newell am 20 Apr. 2017
Bearbeitet: Andrew Newell am 20 Apr. 2017
Use ylim right after yyaxis right.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by