How to show all decimals in axis?

조회 수: 4 (최근 30일)
Philippe Corner
Philippe Corner 2018년 8월 3일
댓글: Walter Roberson 2023년 4월 28일
By default, the axis in matlab plots show the number of decimals simplified by x10^#, how could we obtain this values in axes changing:
from 6.5 x10^5 to 650000?
I have seen that this code:
ax.YAxis.TickLabelFormat = '%.5f';
makes this
6.5 x10^5 to 6.50000 x10^5,
but im looking to delete "x10^5" abbreviation.
Thanks in advance

채택된 답변

Adam
Adam 2018년 8월 3일
ax.YAxis.Exponent = 0;
should do this if you have a sufficiently recent version of Matlab.
  댓글 수: 4
Leslie
Leslie 2023년 4월 28일
R2021b
Walter Roberson
Walter Roberson 2023년 4월 28일
I do not happen to have R2021b installed at the moment. The behaviour I see in R2021a and R2022a is the same as what is shown here:
y = rand(1,20) * 1000000;
ax = subplot(2,1,1);
plot(ax, y);
title('not changing exponent')
ax = subplot(2,1,2);
plot(ax, y);
ax.YAxis.Exponent = 0;
title('changed exponent')

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by