Plot
Plot values from topic message paths which point to numeric fields.
Settings
General
field | description |
---|---|
X-axis value type | Type and source of data for values plotted on the x-axis:
|
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):
|
Axis scales | For Message path (XY plots):
|
Legend
field | description |
---|---|
Position | Position of the legend in relation to the chart (Floating, Left, Top) |
Show legend | Display the legend |
Show values | Show 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
field | description |
---|---|
Default values path | For path-based values: the message path containing default x-axis values for the series. You can also set these individually for each series. |
Axis label | Label displayed for the x-axis |
Show tick labels | Whether or not to display numeric values for x-axis tick marks |
Min | Fixed minimum value for x-axis |
Max | Fixed 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.
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
field | description |
---|---|
Axis label | Label displayed for the y-axis |
Show tick labels | Whether or not to display numeric values for y-axis tick marks |
Min | Fixed minimum value for y-axis |
Max | Fixed maximum value for y-axis |
Series
field | description |
---|---|
Label | Label displayed for the series in the legend |
X-value path | For Message path (XY plots): message path containing x-axis values for the series. Overrides default x-axis values if set. |
Y-value path | Message path containing y-axis values for the series |
Color | Color used to plot the series |
Line size | Width of line connecting data points |
Show line | Show 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:
|
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.
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.
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:
With the Zoom tool on, click and drag to select an area:
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:
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) orOption
(macOS) - Both axes: hold
Shift
+Alt
(Windows) orShift
+Option
(macOS)
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.
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.
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.