# Plot RectangularChart3D in Mathematica 12

I would like to have a 3d rectangle chart looks like the following:

Later on, I will use different transparent color for each small 3d rectangle. It seems that the function RectangleChart3D can give some results, but it only gives one row and not all of them.

does anyone know how to achieve this?

• RectangleChart3D is one of those fake 3D plots, so you won't be able to easily get multiple rows. Depending on your data, you could use DiscretePlot3D (only works for regular grids) Oct 1, 2019 at 12:02
• How about Histogram3D? Oct 1, 2019 at 14:02
• Would it not be simpler and easier to just (scale and) plot individual polygons? Oct 1, 2019 at 16:55

You can use RectangleChart3D with the option ChartLayout -> "Grid":

SeedRandom[1]
data = RandomReal[10, {5, 5, 3}];

RectangleChart3D[data,
ChartLayout -> "Grid",
ColorFunction -> "Rainbow",
ViewPoint -> {10, -10, 10}]


Add the option ChartBaseStyle -> Opacity[.7] to make the cuboids transparent:

To remove the polygon faces and the canvas:

RectangleChart3D[data, ChartLayout -> "Grid",
ColorFunction -> "Rainbow", ImageSize -> Large,
ViewPoint -> {10, -5, 10},
FaceGrids -> None,
"Canvas" -> False,
PerformanceGoal -> "Speed"] /. {Directive[___], p_} :> {
p /. Polygon[a_,  VertexColors -> {c_, ___}] :>
{Antialiasing -> True, EdgeForm[{Opacity[1], Thick, c}], FaceForm[], Polygon[a]}}