geodensityplot
R2026bDensity plot in geographic coordinates
Syntax
Description
Vector and Matrix Data
geodensityplot(
creates a density plot in geographic coordinates. Specify the latitude
coordinates in degrees using lat,lon)lat, and specify the longitude
coordinates in degrees using lon.
To plot one set of coordinates, specify
latandlonas vectors of the same length.To plot multiple sets of coordinates on the same set of axes, specify at least one of
latorlonas a matrix. (since R2026b)
If the current axes is not a geographic axes, or if there is no current axes, then the function creates the density plot in a new geographic axes.
Table Data
Additional Options
geodensityplot(
plots into the geographic axes specified by gx,___)gx. Specify the
axes as the first argument followed by any of the input argument combinations in
the previous syntaxes.
geodensityplot(___,
specifies properties of the density plot using one or more name-value arguments.
For a list of properties, see DensityPlot Properties. Name=Value)
returns the dp = geodensityplot(___)DensityPlot object or a vector of
DensityPlot objects. Use dp to set
properties after creating the plot. For a full list of properties, see DensityPlot Properties.
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Tips
When you plot on geographic axes, the
geodensityplot function assumes that coordinates are referenced to the
WGS84 coordinate reference system. If you plot using coordinates that are referenced to a
different coordinate reference system, then the coordinates might appear misaligned.
Algorithms
A density plot is a surface with varying transparency. The
geodensityplot function creates the surface by calculating a
cumulative probability distribution from the specified points and varying the
transparency with the density of the points.
By default, each point contributes equally to the density plot. When you weight the points, the function multiplies the contribution of the associated points to the density plot.
Alternative Functionality
A density plot is a type of heatmap. Other types of heatmaps that you can create on maps include:
Choropleth maps, which display the values of numeric attributes within polygons. For an example, see Create Choropleth Map from Table Data (Mapping Toolbox).
Binned scatter plots, which partition points into bins and display the number of points in each bin. For an example, see Create Binned Scatter Plot from Latitude and Longitude Data (Mapping Toolbox).
Pseudocolor raster plots, which display the values stored in a raster. For examples, see the
geopcolor(Mapping Toolbox) reference page.
Version History
Introduced in R2018bSee Also
Functions
Properties
1 Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®.









