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

1 回表示 (過去 30 日間)
Ali Rezaei
Ali Rezaei 2012 年 3 月 22 日
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 件)

Geoff
Geoff 2012 年 3 月 22 日
set(gca,'XTick',[1 2.2 3.14]);
  1 件のコメント
Geoff
Geoff 2012 年 3 月 22 日
Or use 'XTickLabel' if you indeed just want to rename the values [1 2 3]

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

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by