bar graph of separate columns from different data sets
Afficher commentaires plus anciens
Hello everyone! I have this problem, I need to upload data from 3 different files and create a single bar for all. What I have got so far is:
path='C:\nath\bars';
eval(['load ' path '\bar1.mat']);
figure
figure1=bar(dist, 'histc');
set(figure1,'FaceColor','g')
hold all
eval(['load ' path '\bar2.mat']);
figure2=bar(dist, 'histc');
set(figure2,'FaceColor','r')
hold all
eval(['load ' path '\bar3.mat']);
figure3=bar(dist, 'histc');
set(figure3,'FaceColor','b')
That gives me a graph where the columns overlap. Is it possible to separate them so that for each bin I have 3 different columns?
Thank you in advance!
Réponses (1)
Image Analyst
le 26 Juin 2014
Attach a screenshot so we can see what you're talking about. While you're at it, attach your .mat files also. And change this
path='C:\nath\bars';
eval(['load ' path '\bar3.mat']);
to this
folder ='C:\nath\bars';
fullFileName = fullfile(folder, '\bar3.mat');
load(fullFileName);
path is a reserved word in the MATLAB language so you don't want to redefine it.
Catégories
En savoir plus sur Environment and Settings 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!
