I have found several ways to change 'colors' and 'groupcolor' however, this only effects the outline color of the box, I would like to change the fill color of the box & whisker plot.
Please help.
Ian, as you probably suspect there's no built-in way to do this. The box is
formed as a series of lines, and it contains no object with a color to fill
in.
Here's how I would do it. There's a relatively simple way to get the
coordinates of the boxes. You can loop over them and make patches with the
same coordinates. You can give those patches a color, and some transparency
so the median line will show through.
load carsmall
boxplot(MPG,Origin)
h = findobj(gca,'Tag','Box');
for j=1:length(h)
patch(get(h(j),'XData'),get(h(j),'YData'),'y','FaceAlpha',.5);
end
-- Tom
Thanks for the advice tom! That code above works perfectly :)
Excellent
Thanks