Issue when removing scientific notation in Matlab plot
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to configure the yticklabels to appear on the graph in a non scientific notation format. My original plot looks like:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/163395/image.png)
In order to remove the scientific notation, I have tried:
set(gca,'YTickLabel',num2str(get(gca,'YTick').'))
a method suggested in the following link: http://uk.mathworks.com/matlabcentral/newsreader/view_thread/279727
and I get the following result:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/163396/image.png)
As it can be seen here, this does not make any sense as the y axis values should increase.
I also tried the following code:
yt=get(gca,'YTick');
set(gca,'YTickLabel',sprintf('%.1f\n',yt))
a method suggested in the following link: http://uk.mathworks.com/matlabcentral/answers/103188-how-do-i-format-tick-labels
and I get the following result:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/163397/image.png)
As it can be seen, this does not make sense either. The top label is missing.
I cannot find the way to get it right. Any help would be appreciated.
1 Kommentar
Nikhil Sreekumar
am 11 Aug. 2016
Which version of MATLAB are you using and can you attach the data used?
Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots 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!