How do I create x-axis in boxplot?
4 views (last 30 days)
Hello everyone. I have a vector named A_T. I have 4 different measurement values for each value of this vector. For example, the measurement values in A_T(1,1) are buffer(1,:). I want to plot a boxplot using this data. The x-axis of the chart should be A_T. A boxplot of 4 measurement values should be drawn for each A_T value. So I realized that this is how boxplot actually works.
For this, I wrote a code like this, but they have to coincide with the value of A_T, we are in vector. How can I do this?
dpb on 2 Oct 2022
Edited: dpb on 2 Oct 2022
You've got the orientation of the array backwards to use boxplot effectively; it thinks columns are variables and rows observations. Use the transpose instead...then write the tick labels as desired.
The labels will probably be kinda' hard to read on earlier releases; I don't know when the above angling became builtin behavior (or if it's just a result of the size of the axes in the online platform that does it) but you can set the rotation angle manually if needs be...but with R202b with a figure only about half size of default didn't result in the labels being rotated, it appeared to reduce font size but kept the horizontal orientation.