trackPlotter
Create track plotter
Description
creates a track plotter for use with the theater plot tPlotter
= trackPlotter(tp
)tp
.
creates a track plotter with additional options specified by one or more
tPlotter
= trackPlotter(tp
,Name,Value
)Name,Value
pair arguments.
Examples
Create a theater plot. Create a track plotter with DisplayName
set to 'Tracks'
and with HistoryDepth
set to 5
.
tp = theaterPlot('XLim',[0,90],'YLim',[-35,35]); tPlotter = trackPlotter(tp,'DisplayName','Tracks','HistoryDepth',5);
Update the track plotter with three tracks labeled 'T1'
, 'T2'
, and 'T3'
with start positions in units of meters all starting at (30, 5, 1) with corresponding velocities (in m/s) of (3, 0, 1), (3, 2, 2) and (3, -3, 5), respectively. Update the tracks with the velocities for ten iterations.
positions = [30, 5, 1; 30, 5, 1; 30, 5, 1]; velocities = [3, 0, 1; 3, 2, 2; 3, -3, 5]; labels = {'T1','T2','T3'}; for i=1:10 plotTrack(tPlotter, positions, velocities, labels) positions = positions + velocities; end
This animation loops through all the generated plots.
Input Arguments
Theater plot, specified as a theaterPlot
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.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'MarkerSize',10
Plot name to display in legend, specified as the comma-separated pair consisting of 'DisplayName'
and a character vector or string scalar. If no name is specified, no entry is shown.
Example: 'DisplayName','Radar Detections'
Number of previous track updates to display, specified as the comma-separated pair
consisting of 'HistoryDepth'
and a nonnegative integer less than or
equal to 10,000. If set to 0, then no previous updates are rendered.
Connect tracks flag, specified as either 'on'
or
'off'
. When set to 'on'
, tracks with the same
label or track identifier between consecutive updates are connected with a line. This
property can only be specified when creating the trackPlotter
.
The default is 'off'
.
To use the trackIDs input argument
of plotTrack
,
'ConnectHistory'
must be 'on'
. If trackIDs is omitted
when 'ConnectHistory'
is 'on'
, then the track
identifiers are derived from the labels input instead.
Colorize track history, specified as either 'on'
or
'off'
. When set to 'on'
, tracks with the same
label or track identifier between consecutive updates are connected with a line of a
different color. This property can only be specified when creating the
trackPlotter
.The default is 'off'
.
ColorizedHistory
is applicable only when
ConnectHistory
is 'on'
.
Marker symbol, specified as the comma-separated pair consisting of
'Marker'
and one of these symbols.
Marker | Description | Resulting Marker |
---|---|---|
"o" | Circle |
|
"+" | Plus sign |
|
"*" | Asterisk |
|
"." | Point |
|
"x" | Cross |
|
"_" | Horizontal line |
|
"|" | Vertical line |
|
"square" | Square |
|
"diamond" | Diamond |
|
"^" | Upward-pointing triangle |
|
"v" | Downward-pointing triangle |
|
">" | Right-pointing triangle |
|
"<" | Left-pointing triangle |
|
"pentagram" | Pentagram |
|
"hexagram" | Hexagram |
|
"none" | No markers | Not applicable |
Size of marker, specified as the comma-separated pair consisting of
'MarkerSize'
and a positive integer in points.
Marker outline color, specified as the comma-separated pair consisting of
'MarkerEdgeColor'
and a character vector, a string scalar, an
RGB triplet, or a hexadecimal color code.
Marker outline color, specified as the comma-separated pair consisting of
'MarkerFaceColor'
and a character vector, a string scalar, an
RGB triplet, a hexadecimal color code, or 'none'
. The default is
'none'
.
Font size for labeling tracks, specified as the comma-separated pair consisting of
'FontSize'
and a positive integer that represents font point
size.
Gap between label and positional point it annotates, specified as the
comma-separated pair consisting of 'LabelOffset'
and a
three-element row vector. Specify the [x
y
z] offset in meters.
Scale factor for magnitude length of velocity vectors, specified as the
comma-separated pair consisting of 'VelocityScaling'
and a
positive scalar. The plot renders the magnitude vector value as VK,
where V is the magnitude of the velocity in meters per second, and
K is the value of VelocityScaling
.
Tag to associate with the plotter, specified as the comma-separated pair
consisting of 'Tag'
and a character vector or string scalar. The
default value is 'PlotterN'
, where
N is an integer that corresponds to the Nth
plotter associated with the theaterPlot
.
Tags provide a way to identify plotter objects, for example when searching using
findPlotter
.
Version History
Introduced in R2018b
See Also
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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)