2

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
Joseph O'Rourke
  • 4,731
  • 25
  • 42

0 Answers0