MATLAB Answers

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

조회 수: 3(최근 30일)
Wolfgang McCormack
Wolfgang McCormack 2021년 7월 31일
댓글: Chunru 2021년 8월 1일
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
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개)

Community Treasure Hunt

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

Start Hunting!

Translated by