How to label x tick at every 2 and y tick at 0.2?

8 ビュー (過去 30 日間)
nam bui
nam bui 2021 年 2 月 17 日
コメント済み: nam bui 2021 年 2 月 17 日
Hello, I have a plot that I want the X-axis labels every 10 to 100 with a tick marks every 2. I also want the Y-axis labels at 2,1,0,-1,-2,-3,-4,-5, with tick marks every 0.2. I'm wondering if any experts can give some command to do it?
Thank you
axis([0 100 -6 2])

採用された回答

Adib Yusof
Adib Yusof 2021 年 2 月 17 日
Hey, try this:
Ax = gca;
set(Ax.XAxis, 'TickValues', 0:10:100, 'MinorTick', 'on', 'MinorTickValues', 0:2:100);
set(Ax.YAxis, 'TickValues', -5:2, 'MinorTick', 'on', 'MinorTickValues', -5:0.2:2);
  1 件のコメント
nam bui
nam bui 2021 年 2 月 17 日
Hello, thank you. This is excatly what i need

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by