hot to plot horizontal Histogram??
24 次查看(过去 30 天)
显示 更早的评论
I would like to plot an horizontal histogram with on the y axis the name of the substances and in the x axis the numbers .
Data=[0 664 320 316 664 664 664 664 320 320 664 664 664 664 664 240 664 229 664 664]
Substances=[a b c d e f g h i l m n o p q r s t u v ]
0 个评论
采纳的回答
Wan Ji
2021-8-30
编辑:Wan Ji
2021-8-30
Try to do this
counts = [0 664 320 316 664 664 664 664 320 320 664 664 664 664 664 240 664 229 664 664];
Substances = 'abcdefghilmnopqrstuv'; %
Categories = categorical(num2cell(Substances));
histogram('Categories',Categories,'BinCounts',counts)
Then the plotted result
2 个评论
Wan Ji
2021-8-30
histogram('Categories',Categories,'BinCounts',counts, 'Orientation','horizontal')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!