Groups of bars, stacked to a different grouping

Groups of bars that are stacked according to a grouping variable, as opposed to the y-axis.
3 Descargas
Actualizado 15 abr 2024

Ver licencia

% twogroup_stacked_bar - plots a bar of a grouped variable that is also stacked by a different grouping
%
% Inputs:
% var - data for binning
% bins - the bin edges, where bins(1) is the left edge of the first bin, and bins(end) is the right edge of the last bin
% groups - the groups from which to do the stacking (usually 1,2,3, etc)
% -name-value arguments-
% 'colors' - (required) a nx3 double of RBG triplets, 1 triplet for each group
% 'percentages' - 'y' to plot the bars as percentages (aka:'Normalisation','probability * 100)
% 'addtofig' - 'y' adds plot to an open figure as the next tile
% 'xlabel' - xlabel string
% 'lgtitle' - title for the legend
% - any public property name and value for the legend() base function ,e.g., 'String',{'Label1','Label2'}
%
% Outputs (in order):
% 1st - cell array of bar handles (one for each bar/bin)
% groupbin - bin data into groups specified by binvals, with option to make percentiles
%
% Inputs:
% var - data
% binvals - bin edges
% -name value arguments-
% 'prcntile' - 'y' to make the binvals percentiles of the data
%
% Outputs (in order):
% groupbin_var - matching length array as var with groups

Citar como

Luke Jenkins (2025). Groups of bars, stacked to a different grouping (https://la.mathworks.com/matlabcentral/fileexchange/163521-groups-of-bars-stacked-to-a-different-grouping), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2024a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Etiquetas Añadir etiquetas

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0.2

added simple grouping function

1.0.1

changed title

1.0.0