How to format YTickLabel with x10^n on when plotting a figure?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Albert Bing
el 24 de Mzo. de 2016
Respondida: Sean de Wolski
el 8 de En. de 2018
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.
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.
0 comentarios
Respuesta aceptada
Sean de Wolski
el 8 de En. de 2018
y = rand(10,1)*5000;
ax = axes;
plot(y)
ax.YAxis.Exponent = 3;
0 comentarios
Más respuestas (1)
Danesh Bankwala
el 8 de En. de 2018
Editada: Danesh Bankwala
el 8 de En. de 2018
Did you ever figure this out? I have a similar problem.
0 comentarios
Ver también
Categorías
Más información sobre Grid Lines, Tick Values, and Labels en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!