Renumber an axis of a figure

I am plotting a figure in which the adjacent elements of the x-axis are 1.224 meters apart. The x-label of the plotted figure will give an impression that the elements are 1 meter apart.
How do I change the numbers on the x-axis to reflect this?

 採用された回答

Geoff
Geoff 2012 年 6 月 1 日

0 投票

You can replace the 'XTick' member of the axis. Here, I just use the handle to the current axis.
x = 0:1.224:10;
y = rand(1,numel(x));
plot(x,y,'.-');
set(gca, 'XTick', x);

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

タグ

質問済み:

2012 年 5 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by