plotyy axis values
8 次查看(过去 30 天)
显示 更早的评论
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
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 ?
采纳的回答
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Two y-axis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!