How to make a grouped boxplot of measurements data from five days?
Mostrar comentarios más antiguos
Hi,
I have a 46x5 matrix with measurement data from 46 points taken on five days, called MyData.
The 46 measurement points belong to three groups. They are saved in a 46x1 vector called Site, with values 1, 2 or 3 representing the three groups.
I'm trying to create a grouped boxplot using:
MyData = rand(46,5);
Site = randi([1 3],46,1);
boxplot(MyData,Site);
but I'm getting an error:
Error using boxplot>straightenX (line 970)
G must be the same length as X or the same length as the number of columns in X.
Error in boxplot (line 274)
[xDat,gDat,origRow,xlen,gexplicit,origInd,origNumXCols] = straightenX(x,g);
G and X actually do have the same length (46), but I assume Matlab doesn't like the fact that the number of columns in X is larger than one.
Does any of you know how to solve it? My goal is to make a boxplot similar to this (just made in Powerpoint:)

Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!