How to format YTickLabel with x10^n on when plotting a figure?
7 次查看(过去 30 天)
显示 更早的评论
How to set the decimal digits of YTickLabel in figure? I tried some ways, but numbers with '%.4f' was too long, numbers with '%.2e' not good, either.
The following figure may be helpful for my question.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/158719/image.png)
The left one uses
set (gca, 'YTickLabel', num2str (get (gca, 'YTick').' , '%.4f) )
The central one uses
set (gca, 'YTickLabel', num2str (get (gca, 'YTick').' , '%.2e) )
And the right one uses the default settings.
What I really want is as following figure.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/158720/image.png)
0 个评论
采纳的回答
更多回答(1 个)
Danesh Bankwala
2018-1-8
编辑:Danesh Bankwala
2018-1-8
Did you ever figure this out? I have a similar problem.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!