Is there a way to fill the boxes in a boxplot in Matlab?
I was able to change the color of the boundaries of the boxes using the colorgroup
option of the boxplot
function (http://www.mathworks.com/help/stats/boxplot.html), but could not find any option to change the or fill the color of the space inside box itself.
Edit: So, I went through the code at the link (http://www.mathworks.com/matlabcentral/newsreader/view_thread/300245) pointed out user1929959 in the comments. However, i am new to Matlab and I would really appreciate a brief explanation of what the code does. Here is the code from that link:
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
I am also open to other solutions. Thanks.