Plot

class foxglove.layouts.PlotPanel

Plot numerical values over time or other values.

For more information, see the documentation.

Example
import foxglove.layouts as fl

layout = fl.Layout(
    content=fl.PlotPanel(
        config=fl.PlotConfig(
            paths=[
                fl.PlotSeries(value="/topic.position.x", label="Position X"),
                fl.PlotSeries(value="/topic.position.y", label="Position Y"),
            ],
        ),
    ),
)
config: PlotConfig
title: str | None = None

The title of the panel.

class foxglove.layouts.PlotConfig

Configuration for the Plot panel.

axis_scales_mode: Optional[Literal['independent', 'lockedScales']] = None

For Expression 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.

floating_legend_position: Optional[Literal['top-left', 'top-right', 'bottom-left', 'bottom-right']] = None

Position of the floating legend over the chart

following_view_width: float | None = None

For Sliding time window: range of time in seconds

is_synced: bool | None = None

For Timestamp plots: Sync timeline to other Plot and State Transitions panels.

legend_display: Optional[Literal['floating', 'top', 'left']] = None

Position of the legend in relation to the chart

max_x_value: float | None = None

For Fixed time window: max value in seconds

max_y_value: str | float | None = None

Fixed maximum value for y-axis

min_x_value: float | None = None

For Fixed time window: min value in seconds

min_y_value: str | float | None = None

Fixed minimum value for y-axis

paths: list[PlotSeries] | None = None

The list of series to display in the panel.

playback_bar_position: Optional[Literal['center', 'right']] = None

For Sliding time window: either at the center or the right edge

right_y_axis: PlotRightAxis | None = None
secondary_axes: list[PlotSecondaryAxis] | None = None

Secondary y-axes configured for the plot. Only the first secondary axis is rendered.

show_legend: bool | None = None

Display the legend

show_plot_values_in_legend: bool | None = None

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)

show_x_axis_labels: bool | None = None

Whether or not to display numeric values for x-axis tick marks

show_y_axis_grid_lines: bool | None = None

Whether or not to display horizontal grid lines for the left y-axis

show_y_axis_labels: bool | None = None

Whether or not to display numeric values for y-axis tick marks

sidebar_dimension: float | None = None

Size of the legend in pixels, when the legend position is Left or Top

time_range: Optional[Literal['all', 'latest']] = None

For Expression plots: - All shows data from the full time range - Latest shows data from the most recent message.

time_window_mode: Optional[Literal['automatic', 'sliding', 'fixed']] = None

For Timestamp plots: - Automatic Last 30 seconds for live data, or the full time range for recorded data - Sliding Specify a sliding time window that follows the current playback time - Fixed Set fixed min and max values for the time axis

x_axis_display_method: Optional[Literal['relative', 'absolute']] = None
x_axis_label: str | None = None

Label displayed for the x-axis

x_axis_path: PlotXAxisPath | None = None
x_axis_val: Optional[Literal['timestamp', 'index', 'custom', 'currentCustom']] = None

Type and source of data for values plotted on the x-axis: - Timestamp: x-values for time series data - Expression: numeric message fields for XY plots - Array index: integer indices of an array in the latest message

y_axis_label: str | None = None

Label displayed for the y-axis

class foxglove.layouts.PlotComparisonSlotOverride

Per comparison slot visibility override for a series, keyed by slot.

enabled: bool | None = None

Set to false to hide this slot. Unset or true means visible.

class foxglove.layouts.PlotDynamicSeriesOverride

Per-sub-series overrides for a dynamic series, keyed by sub-series id.

enabled: bool | None = None

Set to false to hide this sub-series. Unset or true means visible.

class foxglove.layouts.PlotRightAxis

Deprecated. Configuration for the right y-axis in a Plot panel. Use PlotSecondaryAxis in secondaryAxes instead.

label: str | None = None

Label displayed for the y-axis

max: float | None = None

Fixed maximum value for the y-axis

min: float | None = None

Fixed minimum value for the y-axis

show_grid_lines: bool | None = None

Whether or not to display horizontal grid lines for this y-axis

show_tick_labels: bool | None = None

Whether or not to display numeric values for y-axis tick marks

class foxglove.layouts.PlotSecondaryAxis

Configuration for a secondary y-axis in a Plot panel. Only the first secondary axis is rendered.

id: str

Required unique identifier for the secondary y-axis.

label: str | None = None

Label displayed for the y-axis

max: float | None = None

Fixed maximum value for the y-axis

min: float | None = None

Fixed minimum value for the y-axis

show_grid_lines: bool | None = None

Whether or not to display horizontal grid lines for this y-axis

show_tick_labels: bool | None = None

Whether or not to display numeric values for y-axis tick marks

class foxglove.layouts.PlotSeries

A series in a Plot panel.

array_expansion: Optional[Literal['none', 'byIndex']] = None

For Timestamp plots where the y-value expression resolves to an array of numbers: how to expand the array into series. “none” (the default) preserves the expression’s existing behavior: a [:] slice stays in one series, while a bare array expression remains unplottable. “byIndex” plots one sub-series per array index, using the index as the sub-series label.

color: str | None = None

Color used to plot the series

comparison_slots: dict[str, PlotComparisonSlotOverride] | None = None

In comparison mode, per comparison slot visibility for this series, keyed by slot (for example “A”, “B”). Currently supports visibility; a slot is hidden only when its entry sets enabled to false.

dynamic_label_field: str | None = None

For dynamic sub-series from array-of-object messages: field name used as the sub-series identifier (legend). Defaults to label.

dynamic_series_overrides: dict[str, PlotDynamicSeriesOverride] | None = None

For dynamic sub-series (array-of-object messages or array expansion): per-sub-series overrides keyed by the sub-series id (label). Currently supports visibility; a sub-series is hidden only when its entry sets enabled to false. Has no effect when the series is not in dynamic mode.

dynamic_value_field: str | None = None

For dynamic sub-series from array-of-object messages: field name containing the plotted value. Defaults to value.

enabled: bool | None = None

Whether the series is enabled. If disabled, the series will not be displayed in the panel.

id: str | None = None

A unique identifier for the series.

label: str | None = None

Label displayed for the series in the legend

line_size: float | None = None

Width of line connecting data points

line_style: Optional[Literal['solid', 'dashed', 'dotted']] = None

Style of the line connecting data points.

show_line: bool | None = None

Show line connecting data points.

time_range: Optional[Literal['all', 'latest']] = None

For Expression plots: controls whether this series shows all data or only latest data. When omitted, the panel time range is used.

timestamp_method: Optional[Literal['receiveTime', 'publishTime', 'headerStamp', 'customField']] = None

For Timestamp plots, set which source of time information is used for message ordering: - receiveTime is the standard timestamp used for playback message ordering across the app. For live connections, this is when the message was received; for recorded files, this is when the message was originally recorded - customField is a FoxQL expression which can point to any field within the message data containing sec and nsec integers - headerStamp is a header.stamp ROS 1 or ROS 2 field containing sec and nsec integers (and special case of ‘custom field’, above). This typically represents when sensor data was captured - publishTime is an optional MCAP-specific field representing when the event occurred

timestamp_path: str | None = None

FoxQL expression containing a timestamp field on the same topic as the y-value expression

use_right_y_axis: bool | None = None

Deprecated. Whether this series is plotted on the right y-axis. Use yAxisId instead.

value: str | None = None

FoxQL expression containing y-axis values for the series

x_value_path: str | None = None

For Expression plots: FoxQL expression containing x-axis values for the series. Overrides default x-axis values if set.

y_axis_id: str | None = None

The secondary y-axis this series is plotted against. Only an id matching the first configured secondary axis is rendered on the secondary y-axis. When unset, the series uses the primary y-axis.

class foxglove.layouts.PlotSeriesBase

The fields of a Plot series that can be overridden per comparison slot.

color: str | None = None

Color used to plot the series

enabled: bool | None = None

Whether the series is enabled. If disabled, the series will not be displayed in the panel.

label: str | None = None

Label displayed for the series in the legend

line_size: float | None = None

Width of line connecting data points

line_style: Optional[Literal['solid', 'dashed', 'dotted']] = None

Style of the line connecting data points.

show_line: bool | None = None

Show line connecting data points.

class foxglove.layouts.PlotXAxisPath

For Expression plots: the FoxQL expression containing default x-axis values for the series. You can also set these individually for each series.

enabled: bool | None = None

Whether the series is enabled. If disabled, the series will not be displayed in the panel.

value: str | None = None

FoxQL expression containing x-axis values for the series