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

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

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!