Remove Scientific Notations in Plotyy

조회 수: 1 (최근 30일)
anvesh kadimi
anvesh kadimi 2016년 6월 8일
답변: Brendan Hamm 2016년 6월 8일
Hello,
I was using plotyy function to plot two variables on a single plot. [haxes(1:2),hline1,hline2] = plotyy(RefTime,y1,RefTime,y2); grid; I tried using this % set(gca, 'ytickLabel', get(gca, 'ytick')); % to get the actual values, but seems like it doesn't works for plot yy. is there any other way that I can remove 'x 10^4'.
Thanks

채택된 답변

Brendan Hamm
Brendan Hamm 2016년 6월 8일
Which version of MATLAB are you using? If it is 2016a or later we recommend using yyaxis instead.
If it is prior, then you do need to use plotyy as you have done. The issue is, there are actually 2 axes being created and the Current Axes is the one on the left. So, you need to get both axes back which means navigating the graphics hierarchy.
f = gcf; % Get Current Figure;
ax = f.Children; % Get the axes array
rightLabel = ax(1).YTickLabel % Here is the Label you were looking for
Replace any of the above with get and set methods if you wish:
f = gcf;
ax = get(f,'Children');
rightLabel = get(ax(1),'YTickLabel');

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