Struggling with legend on grouped bar charts (Matlab) - MathWorks Well if we start by reading the documentation on legend () we see that we can obtain the handles of a legend and modify the parameters. by adding the following at the end. you change the facecolor of the rectangle shown in the legend box. Theme legend ('2014 Data','2015 Data') [LEGH,OBJH,OUTH,OUTM] = legend;