1
$\begingroup$

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]


GroupTable


$\endgroup$
  • 2
    $\begingroup$ E.g. ListPlot3D[m, Mesh -> None, InterpolationOrder -> 0, Filling -> Bottom, FillingStyle -> Orange]. I guess this has been already asked. $\endgroup$ – Artes Nov 11 '14 at 23:50
  • $\begingroup$ @Artes: Fantastic! Thanks so much! $\endgroup$ – Joseph O'Rourke Nov 11 '14 at 23:51
  • 3
    $\begingroup$ related Q/A: Height-dependent filling color in 3D plots $\endgroup$ – kglr Nov 12 '14 at 0:01
  • $\begingroup$ @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. $\endgroup$ – DumpsterDoofus Nov 12 '14 at 1:24
  • $\begingroup$ @Artes Are you going to post that as an answer or do you think this should be closed as a duplicate? $\endgroup$ – Mr.Wizard Nov 12 '14 at 13:06