How to make scientific notation appear next to each tick/label on axes instead of the top?
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Wolfgang McCormack
el 31 de Jul. de 2021
Comentada: Chunru
el 1 de Ag. de 2021
Hi everyone,
I am having the following graph where scientific notation appears on the top. How can I make the notation to appear next to each axis tick/value?
Thanks in advance.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/699417/image.jpeg)
0 comentarios
Respuesta aceptada
Chunru
el 31 de Jul. de 2021
Editada: Chunru
el 31 de Jul. de 2021
x = linspace(1e-6, 2e-6, 21);
plot(x)
h = gca;
h.YTickLabel = string(x*1e6)+"\times10^{-6}";
4 comentarios
Chunru
el 1 de Ag. de 2021
All these are "manual" and not "auto":
x = linspace(1e-6, 2e-6, 21);
plot(x)
h = gca;
h.YTickLabel = string(x*1e6)+"\times10^{-6}";
h.YTickLabel{1} ="0"; % not the correct value; for demo only
Más respuestas (0)
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!