Increase precision of plot axes

I have some large time values, seconds to minutes of time expressed in nanoseconds-so at least 9 digits. When I plot some value v. time, the x axis is automatically switched a smaller number and a power. I might have 1.455 1.455 1.455 x10^8 instead of 145500000, 145500001, 145500002. How can I make it display the whole number without a power?
Secondly, since they will take up more room, is there a way to angle them at the tick marks?

 채택된 답변

Walter Roberson
Walter Roberson 2013년 3월 13일

1 개 추천

set the axis xticklabel to a cell array of strings that are the displays you want.

댓글 수: 3

Jared
Jared 2013년 3월 13일
I have multiple plots with multiple data sets. Would I need to manually find the minimum and maximum x values in each plot so I can create this cell array, or can I just create a large one from 0 to a large number that will always cover any values I could have? How do I associate a tick mark with a corresponding value in the cell array? Can you elaborate a bit more? Thanks
It's better if you determine your ticks
nticks=5; % number of ticks
ticks=linspace(min(x),max(x),nticks)
curticks = get(gca, 'XTick');
set( gca, 'XTickLabel', cellstr( num2str(curticks(:), '%d') ) );

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

추가 답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 3월 13일
편집: Azzi Abdelmalek 2013년 3월 13일

0 개 추천

s=sprintf('%10d',145500000)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by