- Find the percentiles on the data, using the prctile command, before plotting them with boxplot
- Sort those percentiles, and store the sorting order
- Use a grouping variable (the second argument to the boxplot command), making sure that the grouping variable values are sorted according to the correct order
sort boxplot based on 25-75th percentiles
7 views (last 30 days)
Nikolas Spiliopoulos on 27 Jun 2020
I have a figure with 3 boxplots in it (different colors each of them)
However, I would like to sort them based on the difference between 25th-75th percentile.
Is it possible to do it?
And if yes can I keep the initial colours after they have been sorted?
thanks a lot
the cyclist on 27 Jun 2020
Yes, it is possible. The algorithm would be something like
I could probably give more specific advice if you upload the data and code that you are using now.