Changing xlim with plotyy

14 次查看(过去 30 天)
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?

采纳的回答

Walter Roberson
Walter Roberson 2012-12-5
编辑:Walter Roberson 2016-10-27
xlim(AX(2), [min max])
  3 个评论
William Gracias
William Gracias 2016-10-27
编辑:William Gracias 2016-10-27
This solution doesn't work on Matlab 2015b. Is there any solution to change X axis limits using plotyy in 2015b?
Walter Roberson
Walter Roberson 2016-10-27
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Two y-axis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by