Changing xlim with plotyy

조회 수: 3 (최근 30일)
Amanda
Amanda 2012년 12월 5일
댓글: Walter Roberson 2016년 10월 27일
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