Skip to main content

Plot

Plot values from topic message paths which point to numeric fields.

add series

Settings

General

fielddescription
X-axis value type

Type and source of data for values plotted on the x-axis:

  • Timestamp: x-values for time series data
  • Message path: numeric message fields for XY plots
  • Array index: integer indices of an array in the latest message
These options are described in more detail below.
Sync with other plots

For Timestamp (time series plots):

Sync timeline to other Plot and State Transitions panels.
Time range

For Message path (XY plots):

  • All shows data from the full time range
  • Latest shows data from the most recent message.
Axis scales

For Message path (XY plots):

  • Independent (the default) lets you configure min and max values for the scales independently.
  • 1:1 is useful for when axes have the same units, and will keep the scales locked together. It hides the min/max axis settings and always zooms both axes simultaneously.

Legend

fielddescription
PositionPosition of the legend in relation to the chart (Floating, Left, Top)
Show legendDisplay the legend
Show valuesShow the corresponding y value next to each series in the legend (either at the current playback time or at a point on user hover)

X-axis

fielddescription
Default values pathFor path-based values: the message path containing default x-axis values for the series. You can also set these individually for each series.
Axis labelLabel displayed for the x-axis
Show tick labelsWhether or not to display numeric values for x-axis tick marks
MinFixed minimum value for x-axis
MaxFixed maximum value for x-axis
Range (seconds)For time series data: amount of data to visualize following behind the current playback point time

Time series plots

The default Timestamp option plots y-values against messages timestamps. The zoom state of time series Plot and State Transitions panels in a given layout can be kept in sync for easy comparison.

Current playback time is indicated by a vertical gray bar.

XY plots

The Message path mode produces XY scatter and trajectory plots where both y-values and x-values are extracted from message paths. You can specify x-values either per-series, or set a default for all series. The path can point to a single value or an array of values in the message.

The "Data range" setting controls which messages are plotted.

plot with path x-axis - all

Index-based plots

The Array index mode plots instantaneous data from an array in the latest playback message using the array's index as the x-axis value. For example, if /some_topic.some_array contained the values [5, 10, 15] in a particular message, the resulting points on the chart would be [0, 5], [1, 10], and [2, 15] at that point in time.

Y-axis

fielddescription
Axis labelLabel displayed for the y-axis
Show tick labelsWhether or not to display numeric values for y-axis tick marks
MinFixed minimum value for y-axis
MaxFixed maximum value for y-axis

Series

fielddescription
LabelLabel displayed for the series in the legend
X-value pathFor Message path (XY plots): message path containing x-axis values for the series. Overrides default x-axis values if set.
Y-value pathMessage path containing y-axis values for the series
ColorColor used to plot the series
Line sizeWidth of line connecting data points
Show lineShow line connecting data points. (Not applicable to reference lines.)
Timestamp

For Timestamp (time series plots), set which source of time information is used for message ordering:

  • Log time is the standard timestamp used for playback message ordering across the app
  • Custom field is a message path which can point to any field within the message data containing sec and nsec integers
  • Header stamp is a header.stamp ROS 1 or ROS 2 field containing sec and nsec integers (and special case of 'custom field', above)
  • Publish time is an optional MCAP-specific field

Use the panel settings to add, edit, or remove data series. Use the "X" next to each data series in settings or the plot legend to remove the series.

add series

Enter the field or slice of data you would like plotted on the y-axis using message path syntax as a Series. Entering a single number will create a horizontal line at that value.

If you enter a message path that points to multiple values (e.g. /some_topic/some_array[:].x), the plot will display multiple values each x-axis tick.

Each series can be configured to display a descriptive label via the Label field in settings.

Plot panel settings

User interactions

Pan and zoom

To pan, click and drag using the mouse or trackpad.

To zoom, scroll using the mouse wheel or trackpad. Alternatively, enable the Zoom tool by clicking the button in the toolbar or pressing z on your keyboard:

zoom tool

With the Zoom tool on, click and drag to select an area:

zoom highlight

Click the Reset view button in the panel toolbar (or double-click the panel) to reset to the original viewport, as defined by your panel's range settings:

reset view

Axis zoom control

By default, time series and index-based plots will zoom just the x-axis, while path-based XY plots will zoom both axes simultaneously.

Zoom each axis independently by hovering over the target axis while scrolling with the mouse wheel or trackpad.

You can also use keyboard modifiers to control zoom behavior while scrolling or using the Zoom tool:

  • Y-axis only: hold Shift
  • X-axis only: hold Alt (Windows) or Option (macOS)
  • Both axes: hold Shift+Alt (Windows) or Shift+Option (macOS)
note

Path-based XY plots with 1:1 axis scales enabled will always zoom both axes simultaneously.

Click-to-seek

Hover over any point on the plot to see its details in a tooltip. You'll see a vertical yellow bar appear, as well as a corresponding yellow marker at the same on the playback timeline. Click to seek playback to the yellow marker on the timeline.

note

Only available for recorded data.

Download CSV data

Right-click the plot to download the plotted data as a .csv file.

Math modifiers

The following Math functions are available to append to your Plot panel's message paths:

  • .@abs
  • .@acos
  • .@asin
  • .@atan
  • .@ceil
  • .@cos
  • .@derivative
  • .@log
  • .@log1p
  • .@log2
  • .@log10
  • .@negative
  • .@round
  • .@sign
  • .@sin
  • .@sqrt
  • .@tan
  • .@trunc

Note that .@derivative will not work with scatter plots (i.e. message paths that point to an array of values for each x-axis tick).

See the Javascript Math documentation for more details.

Reference lines

To add a reference line at a constant value in a plot panel, add a series and set the message path to the constant value you would like plotted.

plot with reference value

Downsampling

To improve performance, the Plot panel will downsample data when points are too dense to meaningfully display.

Times series plots

In timestamp mode, the Plot panel will downsample data using a min/max/first/last downsampling algorithm. This downsampling will preserve extremes so even when downsampled, the plot will still show the highest and lowest values for each time period. The points kept during downsampling will always be from the original data — downsampling does not interpolate or create new points.

When data is downsampled, the Plot panel will automatically hide the dots for your data and only show lines. You can zoom until you see dots indicating you are seeing the full original data.

XY plots

In path-based modes, the Plot panel will use different downsampling approaches depending on the "Show lines" setting for the series.

If the series does not have lines enabled, downsampling will remove points which occur at the same pixel location as other points. The rendered plot will look the same as one with no downsampling.

If the series has lines enabled, downsampling will preserve the shape of the data and only remove points which would not alter the shape. When data is downsampled, the Plot panel will automatically hide the dots for your data and only show lines. You can zoom until you see dots indicating you are seeing the full original data.