How to add a favorite vector as labels for plot() function?

How to add a favorite vector as labels for plot() function? For instance I need to display vector [1 2.2 3.14] as x axes labels instead [1 2 3].

回答(1 个)

set(gca,'XTick',[1 2.2 3.14]);

1 个评论

Or use 'XTickLabel' if you indeed just want to rename the values [1 2 3]

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Axis Labels 的更多信息

提问:

2012-3-22

Community Treasure Hunt

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

Start Hunting!

Translated by