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

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

Accepted Answer

Kenta
Kenta on 17 Mar 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 Comments
Ohashi Asuka
Ohashi Asuka on 19 Mar 2020
分かりやすく説明していただき,ありがとうございました.とても助かりました.
Kenta
Kenta on 19 Mar 2020
はい、解決し、よかったです!

Sign in to comment.

More Answers (0)

Categories

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

Products

Community Treasure Hunt

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

Start Hunting!