Changing xlim with plotyy
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Amanda
am 5 Dez. 2012
Kommentiert: Walter Roberson
am 27 Okt. 2016
I'm trying to figure out how to adjust the x axis limits for both y plots. The function:
[AX,H1,H2] = plotyy(pitch,Torque,pitch,RPM)
I understand using xlim([min max]), but that only applies to the first x axis and not the second. Are there any functions or methods to accomplish this?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 5 Dez. 2012
Bearbeitet: Walter Roberson
am 27 Okt. 2016
xlim(AX(2), [min max])
3 Kommentare
William Gracias
am 27 Okt. 2016
Bearbeitet: William Gracias
am 27 Okt. 2016
This solution doesn't work on Matlab 2015b. Is there any solution to change X axis limits using plotyy in 2015b?
Walter Roberson
am 27 Okt. 2016
Example:
x1 = linspace(1,10,20); x2 = linspace(3,8,20); y1 = x1.^3 - 5*x1 + 3; y2 = log(x2);
[AX, H1, H2] = plotyy(x1, y1, x2, y2);
xlim(AX(2), [4 7]);
Tested in R2015b specifically.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Two y-axis 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!