How to stack histograms

73 ビュー (過去 30 日間)
Wesser
Wesser 2021 年 6 月 8 日
回答済み: Star Strider 2021 年 6 月 8 日
Hi,
I'm trying to stack histograms but I'm not having any luck. I would like the data for Security (in blue) to plot along the xaxis and the data for Widefield (in yellow) to sit on top of the Security data.
shist=(MC_participant_Mean(1,Security_all)); %A vector of health info for only the people who lived in security - count of 102
SHist=shist'; %convert row to column
whist=(MC_participant_Mean(1,Widefield_all)); %A vector of health info for only the people who lived in security - count of 99
WHist=whist'; %convert row to column
%figure(1)
histogram(SHist, 'b')
hold on
histogram(WHist, 'y')
hold off
legend('Security', 'Widefield')
These are the errors I'm getting:
>> testSTACK
Error using histogram>parseinput (line 304)
Trailing input arguments must occur in name-value pairs.
Error in histogram (line 145)
[opts,passthrough,dispatchToCategorical] = parseinput(args,firstaxesinput);
Error in testSTACK (line 7)
histogram(SHist, 'b')
The error message is a complete enigma.... Any advice??
Thanks in advance!!

採用された回答

Star Strider
Star Strider 2021 年 6 月 8 日
See my Comment replying to your Comment.

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by