plotyy axis values
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Walter Roberson
am 2 Okt. 2011
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 ?
Akzeptierte Antwort
the cyclist
am 2 Okt. 2011
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Two y-axis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!