ListDensityPlot

ListDensityPlot[array]

generates a smooth density plot from an array of values.

ListDensityPlot[{{x1,y1,f1},{x2,y2,f2},}]

generates a density plot with values defined at specified points.

Details and Options

Examples

open allclose all

Basic Examples  (3)

Use an array of values to define heights for a density:

Give explicit , , coordinates for points in a density:

A larger set of , , samples:

Use different interpolations of data:

Scope  (14)

Data  (8)

For regular data consisting of values, the and data ranges are taken to be integer values:

Provide explicit and data ranges by using DataRange:

For irregular data consisting of triples, the and data ranges are inferred from data:

Areas around where the data is nonreal are excluded:

Use MaxPlotPoints to limit the number of points used:

PlotRange is selected automatically:

Use PlotRange to focus in on areas of interest:

Use RegionFunction to restrict the density to a region given by inequalities:

Presentation  (6)

Add labels:

Color the density by height:

Include a legend:

Provide overlay meshes:

Provide an interactive Tooltip for the density:

Use a theme with simple ticks and a legend in a bold color scheme:

Options  (66)

BoundaryStyle  (4)

No boundary is used by default:

Use a red boundary around the edges of the surface:

BoundaryStyle applies to holes cut by RegionFunction:

BoundaryStyle applies between Voronoi regions associated with the data:

ClippingStyle  (4)

Clipped regions are not shown by default:

Color clipped regions like the rest of the density:

Use pink to fill the clipped regions:

Use light red where the surface is clipped above and pink below:

ColorFunction  (5)

Color by scaled coordinate:

Specify gray-level intensity by scaled coordinate:

Named color gradients color in the direction:

Use brightness to correspond to the height or density of a function:

Use the interpolation between two colors to indicate the height or density of a function:

ColorFunctionScaling  (1)

Get the natural range of values by setting ColorFunctionScaling to False:

DataRange  (4)

Arrays of height values are displayed against the number of elements in each direction:

Rescale to the sampling space:

Triples are interpreted as , , coordinates:

Force interpretation as arrays of height values:

The dataset is normally interpreted as a list of triples:

InterpolationOrder  (5)

Densities are normally blended across polygons:

Use zero-order or piecewise constant interpolation:

Use third-order spline interpolation to fit the data:

Interpolation order 0 to 5:

For irregular data, zero-order interpolation gives Voronoi regions for each point:

MaxPlotPoints  (4)

ListDensityPlot normally uses all the points in the dataset:

Limit the number of points used in each direction:

MaxPlotPoints imposes a regular grid on irregular data:

The grid does not extend beyond the convex hull of the original data:

Mesh  (7)

No mesh is used by default:

Show the initial and final sampling mesh:

The entire mesh for irregular data is a Delaunay triangulation:

Use 5 mesh lines in each direction:

Use 3 mesh lines in the direction and 6 mesh lines in the direction:

Use mesh lines at specific values:

Use different styles for different mesh lines:

MeshFunctions  (3)

Use the value as the mesh function, giving a continuously colored contour plot:

Use mesh lines in the and directions:

Show where the real and imaginary parts of a function are constant over the complex plane:

MeshStyle  (3)

Mesh lines are partially transparent by default:

Use red mesh lines:

Use red mesh lines in the direction and dashed mesh lines in the direction:

PerformanceGoal  (2)

Generate a higher-quality plot:

Emphasize performance, possibly at the cost of quality:

PlotLegends  (5)

No legend is used, by default:

Include a legend:

Legends automatically use the same colors as the density plot:

Use Placed to change legend placement:

Use BarLegend to customize the legend:

PlotRange  (2)

Automatically compute the range and clip extreme portions of it:

Use all points to compute the range:

PlotTheme  (2)

Use a theme with simple ticks and a legend in a bright color scheme:

Change the color scheme:

RegionFunction  (4)

Plot over a region in :

The region depends on DataRange:

Regions do not have to be connected:

Use any logical combination of conditions:

ScalingFunctions  (9)

By default, plots have linear scales in each direction:

Use a log scale in the direction:

Use a linear scale in the direction that shows smaller numbers at the top:

Use a reciprocal scale in the direction:

Use different scales in the and directions:

Reverse the axis without changing the axis:

Use a scale defined by a function and its inverse:

Positions in Ticks and GridLines are automatically scaled:

PlotRange is automatically scaled:

VertexColors  (2)

ListDensityPlot usually colors the density using a color function:

Specify random colors for each vertex:

Applications  (3)

Plot a probability density function of two variables:

Compare to the empirical density function:

Show the regions closest to a set of points:

Show ozone density around the world:

Use CountryData to add country outlines:

Properties & Relations  (16)

ListDensityPlot is similar to ListPlot3D viewed from above:

ListDensityPlot and ListPlot3D view as a function of and :

The data has only one value for each , pair:

The data has two values for each , pair:

Use ListDensityPlot3D to plot 3D data:

ListDensityPlot associates colors with the vertices of polygons:

Raster, ArrayPlot, MatrixPlot, and ReliefPlot associate colors with the whole polygon:

Use ArrayPlot for arrays of discrete data:

Use MatrixPlot for structural plots of matrices:

Use ReliefPlot for matrices corresponding to medical and geographic values:

Use DensityPlot for functions:

Smoothly shade a map using color with GeoDensityPlot:

Use ListPointPlot3D to show three-dimensional points:

ListDensityPlot produces smooth color variations:

Use ListContourPlot to get segmented colors:

Use ListPlot3D to create surfaces from continuous data:

Use ListLogPlot, ListLogLogPlot, and ListLogLinearPlot for logarithmic plots:

Use ListPolarPlot for polar plots:

Use DateListPlot to show data over time:

Use ParametricPlot3D for three-dimensional parametric curves and surfaces:

Possible Issues  (2)

The appearance may depend on the source of the data:

An ×3 matrix is by default interpreted as a list of triples:

Use DataRange->All to force interpretation as a matrix of values:

Or provide an explicit list of data ranges to force interpretation as a matrix of values:

Neat Examples  (1)

Introduced in 1988
 (1.0)
 |
Updated in 2007
 (6.0)
2008
 (7.0)
2012
 (9.0)
2014
 (10.0)
2016
 (11.0)
2017
 (11.1)