How to fill a bar graph with colored (hatching) patterns?

10 views (last 30 days)
Y = xlsread('Data');
X = Y(:,1);
Y1 = Y(:,2);
Y2 = Y(:,3);
figure('Name','Data - Bar Chart');
bar(X,Y1,1.0,'FaceColor','b');
hold on
bar(X,Y2,0.5,'FaceColor','r');
legend('Data 1','Data 2')
% Please suggest how to fill the bar graph here. Thanks in advance.

Answers (1)

M
M on 1 Nov 2017
I am not sure it is implemented in Matlab (maybe using the 'stacked' option of bar graph, you can have a look here ).
Otherwise, I think you can find what you want on the MathWorks File Exchange site : https://fr.mathworks.com/matlabcentral/fileexchange/?utf8=%25E2%259C%2593&term=hatched+bar+graph

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!