Replace the ticks value manually

I have a graph where X axis has values and accordingly ticks at 1,2,3 and so on. I want to define these 1,2, 3 as 10, 15, 25. Everything else needs to stay the same.

回答 (1 件)

Steven Lord
Steven Lord 2018 年 7 月 21 日

0 投票

Do you want to change where on the axes the tick labels are placed (no longer have labels at x = 1, x = 2, x = 3) or do you just want to change the label (have the text "10" at x = 1, etc.)?
For the former, use xticks as madhan ravi suggested or (if you're using a release that predates the introduction of the xticks function) set the XTick property of the axes.
For the latter, use the xticklabels function or set the XTickLabels property of the axes.

2 件のコメント

CHARANPREET SINGH
CHARANPREET SINGH 2018 年 7 月 21 日
Same as xticks, Matlab showing xticklabels as undefined function
madhan ravi
madhan ravi 2018 年 7 月 21 日
Which version are you using?

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

カテゴリ

タグ

質問済み:

2018 年 7 月 21 日

コメント済み:

2018 年 7 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by