plotyy axis values

조회 수: 8 (최근 30일)
Dallas
Dallas 2011년 10월 2일
I am using the plotyy function as below. The plot comes out fine with the correct limits however the axis values on the right hand y-axis (ax(2)) are missing. the zero is in the bottom right corner, and there is a marker nearly at the top but no value on it... is there a way to get it to show the values?
[ax,h1,h2] = plotyy(i*Ac,V,i*Ac,power);
ylim(ax(1),[0 (Nc*1.2)]);
ylim(ax(2),[0 (Nc*0.5*il*Ac)]);
  댓글 수: 2
Walter Roberson
Walter Roberson 2011년 10월 2일
Your Ac data appears to be complex: plot in the two-array case can only plot real values, so for i*Ac to be real, Ac must be complex and have all-zero real components. But then for the second ylim to be real-valued, either il or Nc would have to be complex, but we can see from the first ylim that Nc must be real valued. So is it correct that il is complex ?
Dallas
Dallas 2011년 10월 3일
None of the values are complex. "i" is a 1D array, everything else is a single real number

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

채택된 답변

the cyclist
the cyclist 2011년 10월 2일
Hard to say for sure, since you do not provide the actual data. However, my guess is that, if your limits are ok, then you just need to add the ticks that you want:
>> get(ax(2),'YTick')
to see the current values, and
>> set(ax(2),'YTick',[put values here])
to set them to what you want.
  댓글 수: 1
Dallas
Dallas 2011년 10월 3일
Exactly the kind of thing I was looking for, thanks!!

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

추가 답변 (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