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

조회 수: 8 (최근 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