필터 지우기
필터 지우기

Fixed point numbers on plot axes

조회 수: 4 (최근 30일)
Mark Shore
Mark Shore 2011년 6월 3일
Doubtless this has been answered somewhere already, but I haven't found it.
Is there a simple way to display numbers in fixed point format (e.g. 12345.0, 12345.5, 12346.0, etc.) on a plot axis rather than the default floating point format (1.2345, 1.2346, 1.2346, etc. x 10^4)?

채택된 답변

Titus Edelhofer
Titus Edelhofer 2011년 6월 3일
Hi,
you could do the following:
ytick = get(gca, 'ytick');
yticklabel =strread(sprintf('%.1f;', ytick), '%s', 'delimiter', ';')
set(gca,'yticklabel', ytick)
Titus
  댓글 수: 2
Walter Roberson
Walter Roberson 2011년 6월 3일
Note that any time you set the tick labels yourself, you will need extra work if you want to be able to zoom or pan.
Mark Shore
Mark Shore 2011년 6월 3일
Thanks, that's exactly what I was looking for (for final figures where I don't need to zoom in or pan).

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

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by