Remove Scientific Notations in Plotyy

3 views (last 30 days)
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

Accepted Answer

Brendan Hamm
Brendan Hamm on 8 Jun 2016
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');

More Answers (0)

Categories

Find more on Two y-axis in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!