bar graph with variation in x axis
1 回表示 (過去 30 日間)
古いコメントを表示
mrituanjay kumar
2020 年 8 月 5 日
編集済み: Abdolkarim Mohammadi
2020 年 8 月 5 日
I've to draw a bar graph like of attachment, however I've to vary the x axis values from 20 to 620 with a difference of 30.
Please suggest me the code
0 件のコメント
採用された回答
Abdolkarim Mohammadi
2020 年 8 月 5 日
編集済み: Abdolkarim Mohammadi
2020 年 8 月 5 日
Use the following code. You replace your data with DataY.
figure ('Position', [293,243,900,420]);
DataX = (20:30:620)';
DataY = [
2.5 1.6
3.0 2.0
3.5 2.2
3.6 2.3
4 2.5
4.3 2.7
4.2 2.6
2.5 1.6
3.0 2.0
3.5 2.2
3.6 2.3
4 2.5
4.3 2.7
4.2 2.6
2.5 1.6
3.0 2.0
3.5 2.2
3.6 2.3
4 2.5
4.3 2.7
4.2 2.6
];
BarChart = bar (DataX, DataY);
xticks (DataX);
set (BarChart, {'FaceColor'}, {[0,0,1];[1,1,0]});
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!