Plot Label Format Display

Hi,
suppose my x-axis has values on the scale of 4000 5000 6000 7000 and so on.
However, when I construct these plots, the figure would have the values displayed in scientific notation 10^4 or something.
How can I stop this from happening?

 채택된 답변

dpb
dpb 2013년 8월 23일

0 개 추천

Use the [x|y]ticklabel property to write them explicitly...for purpose of illustration--
axes
ylim([10000 40000])
yt=get(gca,'ytick');
set(gca,'yticklabel',num2str(yt','%d'))
NB: the ' to pass column vector to num2str()
Salt to suit...

댓글 수: 4

T
T 2013년 8월 23일
That doesn't appear to work in my case....it just overwrites the values even if I don't specify ylim([ymin ymax])
dpb
dpb 2013년 8월 23일
편집: dpb 2013년 8월 23일
Not believin' w/o seein'... :)
Show your work. I've done several additional examples here and all seem to work just fine (at least for my definition of "fine"; not positive what you're seeing that isn't satisfactory).
T
T 2013년 8월 28일
This approach worked coincidentally:
However, if one were not using plotyy, what would you recommend?
dpb
dpb 2013년 8월 28일
편집: dpb 2013년 8월 28일
I've no klew what you're asking at this point --
a) what's wrong w/ the previous
b) show code that reproduces the perceived problem(s) and description of what's desired instead, and
c) specify the question of what am suppose to recommend for what?
In general, the answer is always to save the handle to the axes object(s) and use get|set to modify the properties thereof to suit. What, specifically, is dependent on the individual case of which you've only given an initial example and then complained the answer wasn't what wanted but never shown why nor what did want instead.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

질문:

T
T
2013년 8월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by