set limits using xlim for strings
3 ビュー (過去 30 日間)
古いコメントを表示
Hi, I wanted to know how to set string limits for a graph. I wanted to set axis limits as months of a year ('Jan' 'Feb 'Mar'). Also wanted to know whether I can pass an array or pass variable with predefined values in the xlim function. Thanks in advance.
0 件のコメント
採用された回答
Amit
2014 年 2 月 2 日
set(gca,'XTick',1:12,'XTickLabel',{'Jan','Feb','Mar','Apr' .... etc})
2 件のコメント
Image Analyst
2014 年 2 月 3 日
Sure. You can make up a cell array with any string variables you want in it.
index = 1;
for y = 2009 : 2020
ca{index} = y; % or num2str(y) or sprintf('Year=%d', y) or whatever...
index = index + 1;
end
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!