How can I modify the values of the y axes
2 次查看(过去 30 天)
显示 更早的评论
Hello!
How are you?
How can I modify the values of the y axes?
For example, let's suppose that when summing a figure, I get the following (1000, 10000, 100000) on the Y axis but I want it this way (10 ^ 3, 10 ^ 4, 10 ^ 5).
How can you change this automatic matlab configuration? I also want to assign it the interval that I want.
0 个评论
采纳的回答
Star Strider
2021-3-11
Modifying them depends on the axis scale. If they are linearly-scaled, use the Exponent property in Tick Values and Labels in the NumericRuler Properties documentation. However, that does not appear to work on log-scaled axes, so you would likely need to create your own y-tick labels. Use the compose function to create them.
2 个评论
Star Strider
2021-3-11
Try this example with your plot:
x = 0:10;
y = x.^4;
figure
semilogy(x, y)
grid
Ax = gca;
yt = Ax.YTick;
Ax.YTickLabel = compose('10^{%d}',log10(yt));
I cannot tell what your plot is since I have not seen it. This works on the plot in this example.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Legend 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!