How to make scientific notation appear next to each tick/label on axes instead of the top?

11 次查看(过去 30 天)
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.

采纳的回答

Chunru
Chunru 2021-7-31
编辑:Chunru 2021-7-31
x = linspace(1e-6, 2e-6, 21);
plot(x)
h = gca;
h.YTickLabel = string(x*1e6)+"\times10^{-6}";
  4 个评论
Wolfgang McCormack
Wolfgang McCormack 2021-7-31
@Chunru thank you so much. Just one last question, what if it starts with 0? It appears like 0 x 10^-6. How can I just make it appear as 0?
Chunru
Chunru 2021-8-1
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

产品


版本

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by