How to increase yticklabel?

1 回表示 (過去 30 日間)
Ali Najem
Ali Najem 2022 年 12 月 6 日
コメント済み: Ali Najem 2022 年 12 月 6 日
Dear experts,
I have this plot as shown below. I need to increase yticklabel more than 4 I used many ways to do it but still stuck at 4
way1
yticks(1:0.5:5);
yticklabels({'1','1.5','2','2.5','3','3.5','4','4.5','5'})
way2
YTick = 1:0.5:5;
set(gca,'ytick',YTick, 'yTickLabel', strsplit(num2str(YTick)))
The yticklabel doesn't change into what I added! any idea how to fix it?
  2 件のコメント
VBBV
VBBV 2022 年 12 月 6 日
ylim([1 5]) % check if you use ylim after you plot to restrict value to 4
Ali Najem
Ali Najem 2022 年 12 月 6 日
Thank you so much for your answer it worked

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

採用された回答

Dyuman Joshi
Dyuman Joshi 2022 年 12 月 6 日
Change the y-limits
ylim([1 5])
%or more than 5, whatever value is preferable
  1 件のコメント
Ali Najem
Ali Najem 2022 年 12 月 6 日
Thank you so much for your answer it worked

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by