Display contour map
contour(
creates a filled contour
plot on a map. Contours are colored according to data values of corresponding
locations.pd
)
contour(___,
creates a filled contour map with additional options specified by name-value
pair arguments.Name,Value
)
Define names and locations of sites around Boston.
names = ["Fenway Park","Faneuil Hall","Bunker Hill Monument"]; lats = [42.3467,42.3598,42.3763]; lons = [-71.0972,-71.0545,-71.0611];
Create an array of transmitter sites.
txs = txsite("Name",names,... "Latitude",lats,... "Longitude",lons, ... "TransmitterFrequency",2.5e9); show(txs)
Create a signal-to-interference-plus-noise-ratio (SINR) map, where signal source for each location is selected as the transmitter site with the strongest signal.
sv1 = siteviewer("Name","SINR map"); sinr(txs,"MaxRange",5000)
Return SINR propagation data.
pd = sinr(txs,"MaxRange",5000); [sinrDb,lats,lons] = getDataVariable(pd,"SINR");
Compute capacity using the Shannon-Hartley theorem.
bw = 1e6; % Bandwidth is 1 MHz sinrRatio = 10.^(sinrDb./10); % Convert from dB to power ratio capacity = bw*log2(1+sinrRatio)/1e6; % Unit: Mbps
Create new propagation data for capacity and display the contour plot.
pdCapacity = propagationData(lats,lons,"Capacity",capacity); sv2 = siteviewer("Name","Capacity map"); legendTitle = "Capacity" + newline + "(Mbps)"; contour(pdCapacity,"LegendTitle",legendTitle);
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 contour mapDataVariableName
(default) | character vector | string scalarData variable to contour map, 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
.
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 numeric vector. Each level
is displayed as a different colored, filled contour on the map. 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 filled contours, 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 'Colormpa'
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
'Transparency'
— Transparency of contour map0.4
(default) | numeric scalar in the range of [0,1]Transparency of the contour plot, specified as a numeric scalar in the
range [0,1], where 0
is completely transparent and
1
is completely opaque.
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. The default value is the current Site Viewer or a new
Site Viewer, if none is open.
Data Types: char
| string
You have a modified version of this example. Do you want to open this example with your edits?