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