箱ひげ図で個人データ​をプロットしたい(線​で繋がることなく)

5 views (last 30 days)
Raki Kawama
Raki Kawama on 17 Jun 2023
Edited: Raki Kawama on 17 Jun 2023
現在、以下のコードを用いて箱ひげ図を作成しています。個人データもプロットしているのですが、個々人のプロット同士が箱ひげ図同士をまたがって繋がっています。ラインで繋げることなく、個人データのみをプロットしたいのです。
tbl1 = readtable('File name.csv'); %フォルダー内から呼び出し(複数のシートに分ける必要)
TimeOrder = {'A','B','C'};%横軸を定義
tbl1.Time = categorical(tbl1.Time,TimeOrder);%データをグループごとで分類
boxchart(tbl1.Time,tbl1.変数A,'GroupByColor',tbl1.Protocol)%BoxChartの作成
b1 = boxchart(tbl1.Time,tbl1.変数A,'GroupByColor',tbl1.Protocol) %BoxChart格納
meanValue1 = groupsummary(tbl1.変数A,tbl1.Time,'mean');
hold on
plot(meanValue1,'ok','LineWidth',0.1, 'Markersize',5.0,'MarkerFaceColor','k')
plot1 = plot(meanValue1,'ok')
plot1.LineWidth = 0.1;
a = table2cell(tbl1(:,3:4));
aaa = cell2mat(a)
aa = [aaa(1:23,2), aaa(24:46,2), aaa(47:69,2)] %各グループのセルを抽出し、プロットしていますが、ここでラインで繋がります。
for n = 1:23
plot(aa(n,:),':sk')
end
hold off
よろしくお願いいたします。筋ごとに回せば出来はしますが...。

Answers (0)

Categories

Find more on 2 次元および 3 次元プロット in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!