Hi, I am having trouble getting a legend that incorporates both bar graphs (one white & one black) that are plotted together on the same figure using 'hold on'. Each bar also has an error bar. An example of my code is:
figure;
errorbar(x, meanValue, lowerError, upperError, 'k', 'LineStyle', 'none');
hold on;
bar(x, meanValue, 'w');
errorbar(x, -meanValue2, -upperError2, -lowerError, 'k', 'LineStyle', 'none');
bar(x, -meanValue2, 'k');
legend('Label1','Label2');
When I do this, the legend has no color for Label1 (black), but has a color for Label2 (white). How can I get the black color to show up in the legend for Label1. Any help would be greatly appreciated. Thank you.