How to use Alternative Box Plot

2 visualizaciones (últimos 30 días)
Blue
Blue el 7 de Ag. de 2019
Comentada: Blue el 13 de Ag. de 2019
Hi,
I dont have the Statistics and Machine Learning Toolbox and I was wondering if anyone knew how to use the alternative box plot function (pick of the week: https://blogs.mathworks.com/pick/2016/07/08/alternative-box-plot/) ? I dont dont quite understand how the data is supposed to be structured. The following snippet yield the following error: Data are plotted for each column. Each column in the input has only one data point.
import iosr.statistics.*
Hour = 0:23
Power = 1:1000
y = tab2box(Hour, Power); % reshapes to be boxPlot compliant
bp = boxPlot(0:23, y, 'Notch', true, 'Percentile', [10 90]);

Respuesta aceptada

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi el 12 de Ag. de 2019
In order to use boxPlot(x,y) the number of elements in ‘x’ should be equal to the number of columns in ‘y’.
In your code y is of dimensions 9x9. boxPlot didn’t work because x is of dimension (1x24) and number of columns in y are 9.
y' is of dimensions 9x9 because tab2box(Xin,Yin) prepares data, in tabular form, for use in the BOX_PLOT function. Specifically, XIN and YIN are vectors (for example column vectors from a results table). Y is an N-by-P numeric array, where P is the number of unique elements in XIN, and N is the maximum number of occurrences of any individual element of XIN. In cases where elements in XIN do not occur an equal number of times, columns in YIN are padded with NaNs as per the documentation of the function.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by