Increase precision of plot axes

30 ビュー (過去 30 日間)
Jared
Jared 2013 年 3 月 13 日
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 日
set the axis xticklabel to a cell array of strings that are the displays you want.
  3 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 13 日
It's better if you determine your ticks
nticks=5; % number of ticks
ticks=linspace(min(x),max(x),nticks)
Walter Roberson
Walter Roberson 2013 年 3 月 13 日
curticks = get(gca, 'XTick');
set( gca, 'XTickLabel', cellstr( num2str(curticks(:), '%d') ) );

サインインしてコメントする。

その他の回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 13 日
編集済み: Azzi Abdelmalek 2013 年 3 月 13 日
s=sprintf('%10d',145500000)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by