箱ひげ図(boxchart)のX軸Y軸の変更
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
ヒストグラムで作成した図を箱ひげ図で同じように作成しようとしたところX軸とY軸が逆に表示されていたのをヒストグラムと同じように表示させたい。
使用しているコード
[ヒストグラム]
a=poissrnd(3,50,1000)
d=mean(mean(a))
histogram(a)
r = poissrnd(a)
[箱ひげ図]
boxchart(a)
X軸には0~15までの個数
Y軸にはその個数を表示させたい
0 Kommentare
Antworten (1)
Atsushi Ueno
am 19 Jul. 2023
>X軸とY軸が逆に表示されていたのをヒストグラムと同じように表示させたい。
>Y 軸にはその個数を表示させたい
a = poissrnd(3,50,1000);
tiledlayout(2,1);
nexttile
histogram(a); % 入力データはa(:)と解釈される。これと一致させるにはboxchart(a(:))とする必要がある
nexttile
b = boxchart(a(:),'orientation','horizontal');% Y 軸にはその個数を表示させたい
dt = datatip(b,'DataIndex',1);
xlim([0 15]); % X 軸には 0~15 までの個数
0 Kommentare
Siehe auch
Kategorien
Mehr zu データ分布プロット finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!