Borrar filtros
Borrar filtros

Change the distance between boxplots

32 visualizaciones (últimos 30 días)
Imran Kanjoo
Imran Kanjoo el 13 de Nov. de 2021
Comentada: dpb el 14 de Nov. de 2021
I use following code to create the boxplot. I want to change the distance between the two boxes. However, I cant find any property to control the distance.
rng default % For reproducibility
x = randn(100,15);
figure
boxplot(x,'PlotStyle','compact')
set(gca,'FontSize',10,'XTickLabelRotation',90)
Also, the XTickLabelRotation does not change the xtick label orientaiton. How can I change orientaion?

Respuesta aceptada

dpb
dpb el 13 de Nov. de 2021
Editada: dpb el 13 de Nov. de 2021
  1. boxplot doesn't support variably-spaced box locations.
  2. use 'LabelOrientation','Horizontal' to maintain normal tick label orientation.
On the latter, why TMW chose to create a different name for the property instead of maintaining consistency with all other plotting routines is one of those maddening inconsistencies they love to introduce -- more and more so recently, it seems.
I suppose it goes to the specialized plot that's to be easy to use and so doesn't need/shouldn't have all the bells and whistles of a generic axes object. So, they provide the two choices of rotated or not with a different name. I suppose there is some logic there...
  4 comentarios
Imran Kanjoo
Imran Kanjoo el 14 de Nov. de 2021
Hi, thanks for reducing the width of the axes object. The last lines of codes work for me. How can I reduce the verticle axes height?
dpb
dpb el 14 de Nov. de 2021
The position vector is a 4-vector of [left bottom width height]. Adjust as desired. See the doc on axes properties for all the details.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Graphics Object Identification en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by