how to make the empty area of the boxplot smaller?

2 ビュー (過去 30 日間)
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019 年 12 月 25 日
回答済み: Abhilash Padma 2019 年 12 月 30 日
Here is the code I use:
boxplot(Tmean_split.pixels,'widths',0.1)
1.JPG
I want to make the empty area around the box smaller. There is huge empty area befor and after number 1 in x-axis and I want to make it smaller. How can I do that?
I used
xlim([0.9 1.1])
but it made the width of box larger which I dont want.
  2 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 12 月 25 日
Can you provide the code to generate above mentioned plot?
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019 年 12 月 25 日
a=[3987,1269,1.032250000000000e+04,2784,6.331500000000000e+03,1515];
boxplot(a)
%xlim([0.9 1.1])
boxplot(Tmean_split.pixels,'widths',0.1)

サインインしてコメントする。

回答 (1 件)

Abhilash Padma
Abhilash Padma 2019 年 12 月 30 日
You could use the “PlotBoxAspectRatio” property of axes to decrease the size of x-axis so that you can make the empty area of the boxplot smaller. See the following code:
a=[3987,1269,1.032250000000000e+04,2784,6.331500000000000e+03,1515];
ax=axes;
boxplot(ax,a);
ax.PlotBoxAspectRatio=[0.3 1 1];

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by