How to fill a bar graph with colored (hatching) patterns?
10 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
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
0 Comments
See Also
Categories
Find more on Bar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!