# Displaying a matrix as an array of solid rectangular blocks [duplicate]

I would like to plot an array of numbers as a surface, with each number the height of a square, and with the squares connected to adjacent squares with vertical rectangles, up or down as appropriate. So in the end the whole looks like an array of solid rectangular blocks, with square cross-sections.

Is there a way to accomplish this with ListPlot3D? I can get the squares floating in space, but I don't see how to easily connect with vertical rectangles.

m={{1, 2, 3, 4, 5, 6, 7, 8}, {2, 1, 4, 3, 6, 5, 8, 7}, {3, 4, 1, 2, 7,
8, 5, 6}, {4, 3, 2, 1, 8, 7, 6, 5}, {5, 7, 6, 8, 1, 3, 2, 4}, {6, 8,
5, 7, 2, 4, 1, 3}, {7, 5, 8, 6, 3, 1, 4, 2}, {8, 6, 7, 5, 4, 2, 3,
1}};
ListPlot3D[mtab, Mesh -> None, InterpolationOrder -> 0]


• E.g. ListPlot3D[m, Mesh -> None, InterpolationOrder -> 0, Filling -> Bottom, FillingStyle -> Orange]. I guess this has been already asked. – Artes Nov 11 '14 at 23:50
• @Artes: Fantastic! Thanks so much! – Joseph O'Rourke Nov 11 '14 at 23:51
• related Q/A: Height-dependent filling color in 3D plots – kglr Nov 12 '14 at 0:01
• @Artes: Nice, I was going to say you could add the option Exclusions -> None, but then I found out that Exclusions is not a valid option for ListPlot3D. – DumpsterDoofus Nov 12 '14 at 1:24
• @Artes Are you going to post that as an answer or do you think this should be closed as a duplicate? – Mr.Wizard Nov 12 '14 at 13:06