Azzera filtri
Azzera filtri

How do I create x-axis in boxplot?

4 visualizzazioni (ultimi 30 giorni)
studentmatlaber il 2 Ott 2022
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?
for i=1:1:15
hold on

Risposta accettata

dpb il 2 Ott 2022
Modificato: dpb il 2 Ott 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.

Più risposte (0)


Scopri di più su Visual Exploration in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by