I'm wondering if it is possible to get the same grouping behavior of bar
plots into bar3
.
For example, if you plot
bar(rand(3));
you get 3 bars for each point; bar
groups the different y values for each x. Now I would like to do the same with a 3D data. That is that I have several slices of 2D data that I want to visualize as groups of bars. Then, if my data is
data = rand(3,3,2);
I would like to see data(1,1,:)
as a group of bars, and data(1,2,:)
as another group and so on.
Is it possible? I cannot find a way of achieving this.
Edit: I'm adding more details, to explain it better.
Lets said that we have two, or more, sets of data {x_(i,j)^s}
. What I need is to group in the same grid position (i,j)
, all the sets s
. In this question, they are grouping the data sets side by side, not element-wise, like this:
x1(s1) x1(s2) x1(s3) x2(s1) x2(s2) x2(s3) x3(s1) x3(s2) x3(s3)
x4(s1) x4(s2) x4(s3) x5(s1) x5(s2) x5(s3) x6(s1) x6(s2) x6(s3)
x7(s1) x7(s2) x7(s3) x8(s1) x8(s2) x8(s3) x9(s1) x9(s2) x9(s3)
I would like the bar
command behavior, it tends to group when putting more than one data set. I would like to know if it is possible.