Multiple grouping variables in a boxplot

17 visualizaciones (últimos 30 días)
Julia Forst
Julia Forst el 24 de Mzo. de 2020
Respondida: Cris LaPierre el 24 de Mzo. de 2020
Dear all,
For my project, I want to group synapse counts by cochlear positon (frequency) and treatment, i.e. five box plots per position, as seen in the example figure.
I have loaded my excel table into matlab which contains three columns: synapses, frequency and treatment. Unfortunately I have not found any help so far. How do I group data by two variables and display it in a boxplot? Is there a way to assign colours to each group? Any help would be highly appreciated! Thank you.

Respuestas (1)

Cris LaPierre
Cris LaPierre el 24 de Mzo. de 2020
The file exchange may have some code that does this. See this post.
As far as what can be done in MATLAB, here's a simple example that groups Weight by 2 variable.
load carbig.mat
boxplot(Weight,{Cylinders,Model_Year},"ColorGroup",Model_Year)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by