"yyaxis left" not working on 2015b?

조회 수: 20 (최근 30일)
SHR
SHR 2016년 3월 9일
댓글: Walter Roberson 2017년 4월 14일
Hi,
I'd like to produce a scatter plot with two y axis, one on left and one on right side. I tried to follow an example from MathWorks website (topic: yyaxis) , but I get the following error: Undefined function or variable 'yyaxis'.
Is this a bug in the R2015b version?
Specifically, I followed this example:
load('accidents.mat','hwydata')
ind = 1:51;
drivers = hwydata(:,5);
yyaxis left
scatter(ind,drivers)
title('Highway Data')
xlabel('States')
ylabel('Licensed Drivers (thousands)')
  댓글 수: 3
Ganesh P. Prajapat
Ganesh P. Prajapat 2017년 4월 14일
I have the same problem with MATLAB 7.10.0 (2010a)
Steven Lord
Steven Lord 2017년 4월 14일
The answer is the same now as it was a year ago and as it was six months ago. You cannot use a function introduced in one release of MATLAB (in this case release R2016a) in an earlier release of MATLAB (like release R2010a.) Release R2010a came out roughly six years prior to the introduction of yyaxis in R2016a.

댓글을 달려면 로그인하십시오.

채택된 답변

Steven Lord
Steven Lord 2016년 3월 9일
No, this is NOT a bug. The bottom of the documentation page for YYAXIS states that this function was introduced in release R2016a. It is not present and will not work in earlier releases.
  댓글 수: 2
SHR
SHR 2016년 3월 9일
Thank you. I see that in earlier releases plotyy(x,y1,x,y2,'scatter')can be used as an alternative. However, the plotted data for the y1 and y2 are the same color and symbol.
Walter Roberson
Walter Roberson 2017년 4월 14일
Use the [AX,H1,H2] = plotyy(___) form and set() the color and marker properties of H1 and H2 as needed.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

lakshman kumar
lakshman kumar 2016년 10월 20일
please let me know this , to use yyaxis command ,what is the required toolbox i need to add to my matlab2015b?
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 10월 20일
It does not exist at all in R2015b in any toolbox.
You should use plotyy in older releases.

댓글을 달려면 로그인하십시오.

카테고리

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