Making complex(ish) bar graphs?
1 view (last 30 days)
Show older comments
Second question of the day, I have a single set of values on the y axis (in this case lengths from 10-20 "units), and then I have 4 different items I want on the x axis (preferably in different colors), and I want them to be grouped in pairs (for easy comparison). How would I go about doing this?
0 Comments
Answers (1)
Grzegorz Knor
on 20 Sep 2011
Something like this:
y = rand(4,1)*10+10;
bar([1,2],y(1:2),'r')
hold on
bar([3.5,4.5],y(3:4),'g')
set(gca,'xtick',[1 2 3.5 4.5],'xticklabel',{'A','B','C','D'})
ylabel('length [a.u.]')
?
See also:
0 Comments
See Also
Categories
Find more on Spline Postprocessing 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!