boxplotの横軸​に対数スケールを設定​することは可能ですか​?

17 Ansichten (letzte 30 Tage)
Ohashi Asuka
Ohashi Asuka am 17 Mär. 2020
Kommentiert: Kenta am 19 Mär. 2020
横軸を対数スケール,縦軸を線形スケールとした箱ひげ図を作成したいのですが,方法が分かりません.
ひとまずerrbarを使って,平均値と最大・最小値をプロットすることが出来ましたが,
分散も合わせて表示したいので,箱ひげ図が書きたいです.

Akzeptierte Antwort

Kenta
Kenta am 17 Mär. 2020
rng default
x = randn(100,10);
figure
xx=[1:10];
position=round(10.^(0.5.*xx),0);
subplot(3,1,1)
plot(position)
subplot(3,1,2)
boxplot(x,'positions',position)
subplot(3,1,3)
boxplot(x,position,'positions',log(position))
こんにちは、'position'と書いて、そのあとでx方向のプロットする場所を指定できます。上のような例でいかがでしょうか。
xの値が、指数関数的に増加するので、そのままbox plot関数を実行しても、うまく表示できないですが、
下の図ではうまく表示できていると思います。
  2 Kommentare
Ohashi Asuka
Ohashi Asuka am 19 Mär. 2020
分かりやすく説明していただき,ありがとうございました.とても助かりました.
Kenta
Kenta am 19 Mär. 2020
はい、解決し、よかったです!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!