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

100 vues (au cours des 30 derniers jours)
Edoardo Bologna
Edoardo Bologna le 20 Avr 2017
Modifié(e) : Andrew Newell le 20 Avr 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

Réponse acceptée

Andrew Newell
Andrew Newell le 20 Avr 2017
Modifié(e) : Andrew Newell le 20 Avr 2017
Use ylim right after yyaxis right.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by