How do I make a boxplot with a few groups?

60 visualizaciones (últimos 30 días)
Ziv Kassner
Ziv Kassner el 1 de Sept. de 2020
Comentada: Adam Danz el 24 de Sept. de 2020
a = rand(10,2);
b = rand(10,2);
boxplot([a,b]);
I want to have one figure with to groups - a and b, where the two vectors of 'a' will be close and the two vectors of 'b' will be close, but the two groups will be far from one another.
Thanks,
Ziv
  1 comentario
Adam Danz
Adam Danz el 24 de Sept. de 2020
In addition to Abdolkarim Mohammadi-Balani's perfectly fine answer,

Iniciar sesión para comentar.

Respuestas (1)

Abdolkarim Mohammadi
Abdolkarim Mohammadi el 1 de Sept. de 2020
Editada: Abdolkarim Mohammadi el 1 de Sept. de 2020
You can add some columns of NaN.
a = rand(10,2);
b = rand(10,2);
c = nan(10,2);
boxplot([a,c,b]);
xticks ([1,2,5,6]);
xticklabels (["a1","a2","b1","b2"]);

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