Plot propagation data on map
plot(
plots the propagation data
on a map. Each data point is displayed as a circular marker that is colored
according to the corresponding value.pd
)
plot(___,
plots the propagation data with additional options specified by name-value pair
arguments.Name,Value
)
Launch Site Viewer with basemaps and building files for Manhattan. For more information about the osm file, see [1].
viewer = siteviewer("Basemap","streets_dark",... "Buildings","manhattan.osm");
Show a transmitter site on a building.
tx = txsite("Latitude",40.7107,... "Longitude",-74.0114,... "AntennaHeight",80); show(tx)
Create receiver sites along nearby streets.
latitude = [linspace(40.7088, 40.71416, 50), ... linspace(40.71416, 40.715505, 25), ... linspace(40.715505, 40.7133, 25), ... linspace(40.7133, 40.7143, 25)]'; longitude = [linspace(-74.0108, -74.00627, 50), ... linspace(-74.00627 ,-74.0092, 25), ... linspace(-74.0092, -74.0110, 25), ... linspace(-74.0110, -74.0132, 25)]'; rxs = rxsite("Latitude", latitude, "Longitude", longitude);
Compute signal strength at each receiver location.
signalStrength = sigstrength(rxs, tx)';
Create a propagationData
object to hold computed signal strength data.
tbl = table(latitude, longitude, signalStrength); pd = propagationData(tbl);
Plot the signal strength data on a map as colored points.
legendTitle = "Signal" + newline + "Strength" + newline + "(dB)"; plot(pd, "LegendTitle", legendTitle, "Colormap", parula);
Appendix
[1] The osm file is downloaded from https://www.openstreetmap.org, which provides access to crowd-sourced map data all over the world. The data is licensed under the Open Data Commons Open Database License (ODbL), https://opendatacommons.org/licenses/odbl/.
pd
— Propagation datapropagationData
object (default)Propagation data, specified as a propagationData
object.
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
'Type','power'
'DataVariableName'
— Data variable to plotpd.DataVariableName
(default) | character vector | string scalarData variable to plot, specified as the comma-separated pair
consisting of 'DataVariableName'
and a character
vector or a string scalar corresponding to a variable name in the data
table used to create the propagation data container object
pd
. The default value is dynamic and corresponds
to the DataVariableName
property of the
propagationData
object.
Data Types: char
| string
'Type'
— Type of value to plot'custom'
(default) | 'power'
| 'efield'
| 'sinr'
| 'pathloss'
Type of value to plot, specified as the comma-separated pair
consisting of 'Type'
and one of the values in the
Type
column:
Type | ColorLimits | LegendTitle |
---|---|---|
'custom' | [min(Data) max(Data)] | '' |
'power' | [-120 -5] | 'Power (dBm)' |
'efield' | [20 135] | 'E-field (dBuV/m)' |
'sinr' | [-5 20] | 'SINR (dB)' |
'pathloss' | [45 160] | 'Path loss (dB)' |
The default value for Levels
is a linearly spaced
vector bounded by ColorLimits
.
Data Types: char
| string
'Levels'
— Data value levels to plotData value levels to plot, specified as the comma-separated pair
consisting of 'Levels'
and a numeric vector. The
propagation data is binned according to Levels
. The
data in each bin is color coded according to the corresponding level.
The colors are selected using Colors
if specified, or
else Colormap
and ColorLimits
.
Data points with values below the minimum level are not included in the
plot.
The default value for Levels
is a linearly spaced
vector bounded by ColorLimits
.
Data Types: double
'Colors'
— Colors of data pointsColors of the data points, specified as the comma-separated pair
consisting of 'Colors'
and an
M-by-3 array of RGB (red, blue, green) or an array of
strings, or a cell array of character vectors. Colors are assigned
element-wise to values in Levels
for coloring the
corresponding points. Colors cannot be used with
Colormap
and
ColorLimits
.
Data Types: double
| char
| string
'Colormap'
— Color map for coloring points'jet(256)'
(default) | predefined colormap name | M-by-3 array of RGB tripletsColormap for the coloring points, specified as the comma-separated
pair consisting of 'Colormap'
and a predefined
colormap name or an M-by-3 array of RGB (red, blue,
green) triplets that define M individual colors.
Colormap
cannot be used with
Colors
.
Data Types: double
| char
| string
'ColorLimits'
— Color limits for color mapColor limits for the colormap, specified as the comma-separated pair
consisting of 'ColorLimits'
and a two-element vector
of the form [min max]. The color limits indicate the data level values
that map to the first and last colors in the colormap.
ColorLimits
cannot be used with
Colors
.
Data Types: double
'MarkerSize'
— Size of data markers10
(default) | positive numeric scalarSize of data markers plotted on the map, specified as the
comma-separated pair consisting of 'MarkerSize'
and a
positive numeric scalar in pixels.
Data Types: double
'ShowLegend'
— Show color legend on maptrue
(default) | false
Show color legend on map, specified as the comma-separated pair
consisting of 'ShowLegend'
and
true
or false
.
Data Types: logical
'LegendTitle'
— Title of color legendTitle of color legend, specified as the comma-separated pair
consisting of 'LegendTitle'
and a character vector or
a string scalar.
Data Types: string
| char
'Map'
— Map for surface datasiteviewer
objectMap for surface data, specified as the comma-separated pair consisting of
'Map'
and a siteviewer
object.[1]
The default value is the current Site Viewer or a new Site Viewer, if none
is open.
Data Types: char
| string
[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®.
You have a modified version of this example. Do you want to open this example with your edits?