Renumber an axis of a figure

2 次查看(过去 30 天)
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
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 个)

类别

Help CenterFile Exchange 中查找有关 Grid Lines, Tick Values, and Labels 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by