bars are stacked instead of grouped while 'grouped'

2 ビュー (過去 30 日間)
MadjeKoe
MadjeKoe 2022 年 6 月 22 日
コメント済み: MadjeKoe 2022 年 6 月 22 日
hi guys, does anybody maybe know why my bars keep being stacked instead of grouped??
qual = readmatrix('qualtrics_srec.txt');
qual_jong = readmatrix('qualtrics_srec_jong.txt');
qual_oud = readmatrix('qualtrics_srec_oud.txt');
figure
bar(qual(57,3:14),'grouped')
hold on
bar(qual_jong(29,3:14),'grouped')
bar(qual_oud(29,3:14),'grouped')

採用された回答

Scott MacKenzie
Scott MacKenzie 2022 年 6 月 22 日
編集済み: Scott MacKenzie 2022 年 6 月 22 日
To group the bars, use something like this:
qual = rand(57);
qual_jong = rand(29);
qual_oud = rand(29);
d = [qual(57,3:14); qual_jong(29,3:14); qual_oud(29,3:14)];
figure
bar(d); % or use d' depending on the desired grouping
The 'grouped' modifier has no effect in your code because the data in each bar function are just a vector.
  1 件のコメント
MadjeKoe
MadjeKoe 2022 年 6 月 22 日
Thank you so much!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by