How to create two-dimensional boxplots

48 vues (au cours des 30 derniers jours)
Tom Rüther
Tom Rüther le 16 Jan 2023
Commenté : Tom Rüther le 16 Jan 2023
Hey all,
I would like to create a two-dimensional boxplot. So far I only managed to create 1D Boxplots with fixed x-value using boxchart. The result should be something like the below image:
On stackoverflow I found a solution for R and Python (matlplotlib), unfortunately I didn't find anything for Matlab.
Python (matplotlib) solution
I would be happy if someone has a clever idea for the solution. Thanks in advance and best regards,

Réponse acceptée

Kevin Holly
Kevin Holly le 16 Jan 2023
Modifié(e) : Kevin Holly le 16 Jan 2023
x = rand(1,30);
y = rand(1,30);
hold on
  1 commentaire
Tom Rüther
Tom Rüther le 16 Jan 2023
Dear Kevin,
thank you for this very nice and easy solution!
Best regards,

Connectez-vous pour commenter.

Plus de réponses (1)

Constantino Carlos Reyes-Aldasoro
Have a look at this code:
It describes how to do 3D boxplots, if you only have one grouping, it would go down to 2D
  1 commentaire
Tom Rüther
Tom Rüther le 16 Jan 2023
Dear Constantino,
Thank you for your quick reply, unfortunately this does not work for the desired plot as I would like to display the information in x-direction as well.

Connectez-vous pour commenter.


En savoir plus sur Graphics Object Programming dans Help Center et File Exchange




Community Treasure Hunt

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

Start Hunting!

Translated by