Create a simple function with arguments {i,j}
, and make a Table
for an array of values. For example:
f[i_, j_] := i*j;
data = Table[f[i, j], {i, 1, 25}, {j, 1, 25}]
I want to create a 3D 'bar chart' of data
- i.e., a plot that has a column of height f[i, j]
at each Cartesian point {i,j}
(ideally a block-shaped column with width and depth 1
centred on {i,j}
. It sounds dead simple...
But ListPlot3D
creates a meshed surface, not a series of columns, and I can't see an option to change this. And Histogram3D
doesn't accept the format of data
, and in any case I can't get my head around how it generates 3D information from pairs containing only 2 data points each - it's set up for data sampling, not plotting.
Suggestions?
ListPlot3D[data, InterpolationOrder -> 0, MeshStyle -> None, ColorFunction -> Hue]
? $\endgroup$