I am trying to plot a matrix with bars, and show what the perfect case would give in the form of non-filled bars. The bars I was able to create:
data = {{0.002, 0, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`}, {0.`, 0.003`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`}, {0.`, 0.`, 0.0023`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`}, {0.`, 0.`, 0.`, 0.001`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`}, {0.`, 0.`,0.`, 0.`, 0.25`, 0.`, 0.`, 0.`, 0.3`, 0.`, 0.`, 0, 0.`, 0.`, 0.`,0, 0.`, 0.`}, {0.`, 0.`, 0.`, 0.`, 0.`, 0.01`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`}, {0.`, 0.`, 0.`, 0.`,0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.20, 0.`, 0.`, 0.`,0.`}, {0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.010, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`}, {0.`, 0.`, 0.`, 0.`, 0.`, 0.`,0.`, 0.`, 0.0021, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`}, {0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.002, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`}, {0.`, 0.`, 0.`, 0.`, 0.`, 0.`,0.`, 0.`, 0.`, 0.`, 0.02, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`}, {0.`, 0.`, 0.`, 0.`, 0.2, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.2,0.`, 0.`, 0.`, 0.1, 0.`, 0.`}, {0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.005, 0.`, 0.`, 0.`, 0.`, 0.`}, {0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`,0.`, 0.001, 0.`, 0.`, 0.`, 0.`}, {0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.0020`, 0.`, 0.`, 0.`}, {0.`, 0.`, 0.`, 0.`, 0, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.2, 0.`, 0.`, 0.`, 0.30, 0.`, 0.`}, {0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.00, 0.`}, {0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`, 0.`,0.`, 0.`, 0.`, 0.`, 0.`, 0.000}};
data3D = Join @@ MapIndexed[Append[#2, #] &, data, {2}];
col = {0.5, 0.2, 0.5};
bar[n_][{x_, y_, z_}] := {Opacity[1], Hue[((Sqrt[y^2 + x^2])/(3 Length[data])) + .14], Cuboid[{x - n, y - n, 0}, {x + n, y + n, z}]}
image = Graphics3D[bar[0.3] /@ data3D, Axes -> True, Ticks -> {{{1, ""}}, None, {0, .1, .2, .3, {.35, ""}}}, BoxRatios -> {1, 1, .6}, Boxed -> False, FaceGrids -> {{{-1, 0, 0}, {{0.3, 18.7}, {0, .1, .2, .3, .35}}}, {{0, 1, 0}, {{0, 18.7}, {0, .1, .2, .3, .35}}}, {{0, 0, -1}, {{0.3, 18.7}, {0.3, 18.7}}}}]
What I would like is that the filled bars are overlayed with with unfilled bars. One wonderful example can be seen here.
How can one add these unfilled bars? (In my example, they should all go up to 0.4.).
And optionally: In this plot, there are color codes outside the actual matrix (grey + blue/red/green/violet). How can that be done?
BarChart3D
to achieve precisely this sort of outcome, but for some reason, one cannot combineChartLayout->{"Stacked","Grid"}
as one would expect. In the future, I suspect this type of feature will be available and automatic, so that you would simply typeBarChart3D[data,ChartLayout->{"Stacked","Grid"}]
to produce the chart you desire. $\endgroup$