# ListDensityPlot

In Mathematica help it's written that:

ListDensityPlot[array] -> generates a smooth density plot from an array of values.

There is also an example:

 ListDensityPlot[{{1, 1, 1, 1}, {1, 2, 1, 2}, {1, 1, 3, 1}, {1, 2, 1, 4}}, Mesh -> All]


I understand when the input is in the form of $\{ x, y, f(x,y)\}$, what this function does. But, I really cannot understand what this function does when it has an array as an input.

-
What does the forth element mean in the example above? I think for density plot we mush have two value for coordinate and one value for the intensity or density in that coordinate. But in the example above I cannot find such a pattern. – MOON May 9 '14 at 15:54
please note the preamble in the documentation for the example: "Use an array of values to define heights for a density". See also ReliefPlot and see the effect of arrays of various sizes eg 7x 5 or whatever you like. Look through all the examples. – ubpdqn May 9 '14 at 16:36

each value in an array is the value that generates color for Integer coordinates like (1,1) between those an interpolation is done by ListDensityPlot.

## Matrices world:

• First index refers to rows
• First row is the top one

## Graphics world

• First coordinate refers to "columns"
• First "row" refers to the bottom one.

Panel@Grid[{
{MatrixForm@array,
Grid[MapIndexed[
Framed[#,
Background ->
Directive[Opacity@.8, Blend["Rainbow", #2[[1]]/4]],
ImageSize -> 35 {1, 1}, Alignment -> Center,
BaseStyle -> {Bold, White}] &, array, {2}],
Spacings -> 1.5 {1, 1}]
,
ListDensityPlot[array,
BaseStyle -> 24, Mesh -> Full, MeshStyle -> White,