Main Content

plot

Plot GPS data

Since R2024b

Description

plot(gpsData) plots the GPS coordinates in the input GPSData object gpsData.

plot(gpsData,Name=Value) specifies options using one or more name-value arguments. For example, MarkerSize=5 plots the GPS waypoints with a marker size of 5.

example

axesHandle = plot(___) returns a figure handle as a Line object using any combination of input arguments from previous syntaxes.

Note

This function requires the Scenario Builder for Automated Driving Toolbox™ support package. You can install the Scenario Builder for Automated Driving Toolbox support package from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.

example

Examples

collapse all

Load recorded GPS data into the workspace.

load("recordedGPSData.mat")

Initialize a GPSData object using information from the loaded GPS data.

gpsData = scenariobuilder.GPSData(timestamps,latitudes,longitudes,altitudes)
gpsData = 
  GPSData with properties:

          Name: ''

    NumSamples: 392
      Duration: 19.5498
    SampleRate: 20.0513
    SampleTime: 0.0500
    Timestamps: [392×1 double]

      Latitude: [392×1 single]
     Longitude: [392×1 single]
      Altitude: [392×1 single]

    Attributes: []

Plot the GPS data object.

plot(gpsData)

Plot the GPS data object with a marker size of 1.

figure
plot(gpsData,MarkerSize=1)

Input Arguments

collapse all

GPS data, specified as a GPSData 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: plot(gpsData,MarkerSize=5) plots the GPS waypoints with a marker size of 5.

Parent figure, specified as a Figure object or Panel object. If you do not specify Parent, the function creates a geographic axes and plots the GPS data in a new figure.

Line style, marker, and color, specified as a string scalar or character vector containing symbols. For more information, see LineSpec in another plot function.

Line width, specified as a positive scalar in points, where 1 point = 1/72 of an inch. If the line has markers, then the line width also affects the marker edges.

The line width cannot be thinner than the width of a pixel. If you set the line width to a value that is less than the width of a pixel on your system, the line displays as one pixel wide.

Marker size, specified as a positive scalar in points, where 1 point = 1/72 of an inch.

Marker fill color, specified as "none", "auto", an RGB triplet, a hexadecimal color code, a color name, or a short color name. The "auto" option uses the same color as the Color property of the parent axes. If you specify "auto" and the axes plot box is invisible, the marker fill color is the color of the figure. For more information, see MarkerFaceColor in another plot function. The "none" option renders the markers without a fill color.

Zoom level of the plot, specified as a positive integer in the range [0, 25]. Increase the zoom level by one to double the map scale. By default, the function specifies the ZoomLevel value based on the range of the coordinates in the GPS data object.

Line color, specified as an RGB triplet, a hexadecimal color code, a color name, or a short color name. For more information, see Color in another plot function.

Output Arguments

collapse all

Figure handle, returned as a GeographicAxes object. For more information on geographic axes properties, see GeographicAxes Properties.

Version History

Introduced in R2024b