Remove Scientific Notations in Plotyy
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
anvesh kadimi
le 8 Juin 2016
Réponse apportée : Brendan Hamm
le 8 Juin 2016

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
0 commentaires
Réponse acceptée
Brendan Hamm
le 8 Juin 2016
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Two y-axis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!