geoplot
Plot line in geographic coordinates
Syntax
Description
Vector Data
geoplot(
plots a line in a geographic axes with vertices at the latitude-longitude
locations specified (in degrees) by the vectors lat
,lon
)lat
and
lon
. The lat
and
lon
inputs must be the same size. By default,
geoplot
draws a solid line, with no markers, using colors
specified by the ColorOrder
property of the geographic axes
object.
geoplot(lat1,lon1,...,latN,lonN)
combines the plots
specified by several sets of latitude-longitude locations.
geoplot(lat1,lon1,LineSpec1,...,latN,lonN,LineSpecN)
combines the plots specified by several sets of latitude-longitude locations,
with a separate LineSpec
for each line.
Table Data
geoplot(
plots the variables tbl
,latvar
,lonvar
)latvar
and lonvar
from
the table tbl
. To plot one data set, specify one variable for
latvar
and one variable for lonvar
. To
plot multiple data sets, specify multiple variables for
latvar
, lonvar
, or both. If both
arguments specify multiple variables, they must specify the same number of
variables. (Since R2022b)
Additional Options
geoplot(
plots in
the geographic axes specified by gx
,___)gx
instead of the current
axes.
geoplot(___,
specifies properties of the chart line using one or more name-value
arguments.Name,Value
)
returns
a column vector of Chart Line objects. Each object corresponds to a plotted
line. Use h
= geoplot(___)h
to modify the properties of the Chart line
objects.
Note
Mapping Toolbox™ extends the functionality of the geoplot
(MATLAB®) function. It adds support for displaying points, lines, and polygons with coordinates in any supported geographic or projected coordinate reference system (CRS). For the geoplot
(Mapping Toolbox) page, see geoplot
(Mapping Toolbox).
Examples
Input Arguments
Output Arguments
Tips
Mapping Toolbox extends the functionality of the
geoplot
(MATLAB) function. It adds support for displaying points, lines, and polygons with coordinates in any supported geographic or projected coordinate reference system (CRS). For thegeoplot
(Mapping Toolbox) page, seegeoplot
(Mapping Toolbox).Plot 3-D geographic data using the Mapping Toolbox functions
geoglobe
(Mapping Toolbox) andgeoplot3
(Mapping Toolbox).When you plot on geographic axes, the
geoplot
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 may appear misaligned.You cannot plot data that requires Cartesian axes in a geographic axes.
To plot additional data in the geographic axes, use the
hold on
command.
Version History
Introduced in R2018b1 Alignment of boundaries and region labels are a presentation of the feature provided by the data vendors and do not imply endorsement by MathWorks®.