0

I was using ListPlot3D and noticed that it wasn't plotting the last elements of my two dimensional list. (i.e. My 5x10 matrix was only showing a 4x9 set of data). However, when I use just an arrayplot it works beautifully. A Simple set of data I used is below:

    Temp = Table[0, {10}, {5}];
    Temp[[1, 3]] = 10;
    Temp[[2, 2 ;; 4]] = 10;
    Temp[[3 ;; 8, All]] = 10;
    Temp[[9, 2 ;; 4]] = 10;
    Temp[[10, 3]] = 10;

    ArrayPlot[Temp]

Sample Array Plot

    ListPlot3D[Temp, InterpolationOrder -> 0, Mesh -> None]

3D Image

When I use the 3D plot, only one point on the diamond show up and the far right side is missing. I specifically want InterpolationOrder = 0, because for my case I want it to be essentially a 3DArray plot.

Pfab
  • 23
  • 3

1 Answers1

3

For the requirement

I want it to be essentially a 3DArray plot.

you can use DiscretePlot3D using your Temp to define a function foo:

ClearAll[foo];
(foo[##2] = #) & @@@ (Join @@ MapIndexed[Flatten@{##} &, Temp, {2}]);


DiscretePlot3D[foo[t, u], {t, 1, 10}, {u, 1, 5}, ExtentSize -> Full, 
 BoxRatios -> {1, 1/2, 1}]

Mathematica graphics

kglr
  • 394,356
  • 18
  • 477
  • 896