Code covered by the BSD License
Christopher Hummersone (view profile)
08 May 2014
14 May 2014)
Draw a box plot with sub-grouping and/or arbitrary box spacing
Watch this File
An alternative implementation of Matlab's boxplot function, with a slightly different interface. The function allows boxes to be arbitrarily spaced, sub-grouped data to be plotted, and various display parameters to be modified. No toolboxes required.
Note: requires quantile2.m from http://www.mathworks.co.uk/matlabcentral/fileexchange/46555-quantile2-m
There's example code in the file help...
Can you attach the code example for the figure you have at the top?
@Alberto you mean the box colour? Use the 'boxColor' option and set it, for example, to [1 1 1; .5 .5 .5] (assuming you have two boxes per y-tick). Setting parameters for each group is described towards the bottom of the help text.
Nice function, it works as promise. I miss the option , (or i don't know how to do it ) to fill the notch with a specified color like on the figure example.
Changed/corrected quantile estimation algorithm. Details in help text.
Moved quantile calculation to new function.
Function now natively supports sub-groups, handles NaNs more robustly, and returns sample size(s). A few other minor tweaks and doc changes.