contour
Description
contour(
creates a filled contour
plot from the specified propagation data object in the current Site Viewer.
Contours are colored according to data values of corresponding locations.pd
)
contour(___,
specifies options using name-value arguments.Name=Value
)
Examples
Capacity Map Using SINR Data
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 the capacity map and display the contour plot.
pdCapacity = propagationData(lats,lons,"Capacity",capacity); sv2 = siteviewer("Name","Capacity map"); legendTitle = "Capacity" + newline + "(Mbps)"; contour(pdCapacity,"LegendTitle",legendTitle);
Input Arguments
pd
— Propagation data
propagationData
object
Propagation data, specified as a propagationData
object.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: contour(pd,Transparency=0.8)
specifies the transparency
of the contour plot.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: contour(pd,"Transparency",0.8)
specifies the
transparency of the contour plot.
DataVariableName
— Data variable to contour
DataVariableName
(default) | character vector | string scalar
Data variable to contour, specified as a character vector or a string
scalar. The data variable must correspond to a variable name of the
table used to create 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 "custom"
,
"power"
, "efield"
,
"sinr"
, or "pathloss"
. This
table shows the default color limits and legend title for each
type.
Type | Color limits | Legend title |
---|---|---|
"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) |
Data Types: char
| string
Levels
— Data value levels to plot
numeric vector
Data value levels to plot, specified as a numeric vector. Site Viewer
displays each level as a filled contour on the map. The function selects
the colors for the contours by using the Colors
argument, if specified, or else the Colormap
and
ColorLimits
arguments. The function does not
display data points with values below the minimum level.
The default value for Levels
is a linearly spaced
vector bounded by the value of the ColorLimits
argument.
Data Types: double
Colors
— Colors of filled contours
M-by-3 array of RGB | array of string scalars | cell array of character vectors
Colors of the filled contours, specified as an
M-by-3 array of RGB triplets, an array of string
scalars, or a cell array of character vectors. The function assigns the
colors to the corresponding values specified by the
Levels
argument.
The Colors
argument cannot be combined with the
Colormap
or ColorLimits
arguments.
Data Types: double
| char
| string
Colormap
— Colormap for coloring points
jet
(default) | predefined colormap name | M-by-3 array of RGB triplets
Colormap for coloring the points, specified as a predefined colormap name or an M-by-3 array of RGB triplets that define M colors.
The Colormap
argument cannot be used with the
Colors
argument.
Data Types: double
| char
| string
ColorLimits
— Color limits for color map
two-element vector
Color limits for the colormap, specified as 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.
The ColorLimits
argument cannot be used with the
Colors
argument.
Data Types: double
Transparency
— Transparency of contour plot
0.4
(default) | numeric scalar in range [0, 1]
Transparency of the contour plot, specified as a numeric scalar in the
range [0, 1]. 0
is completely transparent and
1
is completely opaque.
Data Types: double
ShowLegend
— Show color legend on map
true
(default) | false
Show the color legend on the map, specified as true
or false
.
Data Types: logical
LegendTitle
— Title of color legend
character vector | string scalar
Title of the color legend, specified as a character vector or a string scalar.
Data Types: string
| char
Map
— Map for surface data
siteviewer
object
Map for the surface data, specified as 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
Version History
Introduced in R2020a
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®.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)