3D grouped mat lab bar graph
1 view (last 30 days)
Show older comments
Hi I have two grouped bar graphs. The first one is for x=1 and the second one is for x=2. I want to combine both at the same with a 3D view. My code is here
clear all
clc
close all
%at x=1
a=[11;7;14;11;43;38];
b=[11;13;17;13;51;46];
c=[9;11;20;9;69;76];
y1=[a b c];
%at x=2
d=[38;61;75;38;28;33];
e=[46;132;135;88;36;51];
f=[76;186;180;115;85;72];
y2=[d e f];
figure(1)
bar3(y1,'grouped')
title('Grouped Style')
ylabel('y1')
zlabel('z1')
figure(2)
bar3(y2,'grouped')
title('Grouped Style')
ylabel('y2')
zlabel('z2')
I want to group the second set of data in x direction. I group y1 and y2 at the same x - axis. I want y1 grouped at x=1 and y2 at x=2. Like in the figure below but grouped at x=1 and x=2.Please help!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/157388/image.jpeg)
Any help is appreciated!
Thank you
0 Comments
Answers (0)
See Also
Categories
Find more on Discrete Data 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!