How to fill a bar graph with colored (hatching) patterns?
Afficher commentaires plus anciens
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.
Réponses (1)
M
le 1 Nov 2017
0 votes
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
Catégories
En savoir plus sur Bar Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!