> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Live plots and math channels

> Plot Teleplot-formatted serial or RTT output in a Monitor tab, add math channels, and export the recording.

Use a **Plot** tab in the Monitor to watch numeric values that your firmware prints over serial or RTT. You can arrange axes, add calculated channels without changing firmware, and export the recording as CSV.

To have Inlay build a custom view instead, ask it to plot the signals. It creates a [project dashboard](/docs/core-concepts/dashboards.md) and opens it in the Monitor:

```text theme={"theme":"css-variables"}
Create a dashboard plotting battery_voltage and charge_current from the
connected device, with separate axes.
```

## Send values from firmware

The Plot tab reads Teleplot lines, one channel per line:

```text theme={"theme":"css-variables"}
>temperature:23.5§°C
>motor_rpm:1500§RPM
>accel_x:1000:0.25§g
>state:Running|t
```

| Part | Example | Meaning |
| - | - | - |
| `>name:value` | `>motor_rpm:1500` | A numeric sample for the channel `motor_rpm`. |
| `§unit` | `>temperature:23.5§°C` | Optional unit after the value. |
| `name:timestamp:value` | `>accel_x:1000:0.25` | Optional device timestamp in milliseconds before the value. |
| `\|t` | `>state:Running\|t` | A text value. It appears in the channel bar with its latest text instead of as a curve. |

For Arduino-style firmware:

```c theme={"theme":"css-variables"}
Serial.printf(">temperature:%.2f§°C\r\n", temperature);
```

Print from the main loop or a task, not from a timing-sensitive interrupt handler. Device timestamps keep the sample spacing correct when output arrives in batches. A Plot tab tracks up to 100 channels per port.

## Open a Plot tab

1. Connect the serial or RTT stream that carries the values.
2. Run `/plot`, or in VS Code run **Inlay: Open Inlay Plot** from the Command Palette. The Monitor opens on a **Plot** tab. In the terminal UI, it opens in your browser.
3. To open another Plot tab, select **+**, then choose **Plot** under **Views**. A configuration you saved earlier appears under **Saved plots**.
4. Select **Source** in the toolbar. Under **Start on a port**, select **Start** next to the port. To plot a port that is already streaming in another tab, select **Mirror** next to it under **Live sources**.
5. Check the discovered channel names and units in the channel bar.

If the list shows **No serial ports available**, connect the serial port first. To stop plotting a port, select the stop control beside it under **This tab**.

If the firmware prints a different format, **Format not recognised** appears under the port in the source list. Select **Fix in chat** to send the unmatched lines to the chat. Inlay builds a [project dashboard](/docs/core-concepts/dashboards.md) that parses your format. Verify its values against the original output.

## Arrange the view

| Control | Use |
| - | - |
| Double-click the tab name | Name the recording. |
| **Window** | Show **30s**, **1m**, **5m**, or **All** of data. |
| **Pause** / **Resume** | Freeze the display and continue. |
| Actions menu > **Math channels…** | Add calculated channels. |
| Actions menu > **Export CSV** | Save the active recording as a CSV file. |
| Actions menu > **Save config** | Save the window, channel settings, and math channels. The configuration appears under **Saved plots** in a new Monitor tab. |
| Actions menu > **Clear plot** | Clear the plotted data. |

The actions menu is the last button in the toolbar.

Select a channel in the channel bar to show or hide it. Select the arrow beside a channel, or right-click the channel, to configure its **Label**, **Axis** (**Left** or **Right**), **Color**, and **Range** (minimum and maximum).

## Compare two signals

The Plot tab draws signals against time. For an XY view, such as current against voltage for an I-V curve, ask Inlay for a dashboard:

```text theme={"theme":"css-variables"}
Create a dashboard with an XY plot of charge_current against battery_voltage
from the connected device.
```

When the two signals come from separate channels, the dashboard pairs their latest values. Use signals sampled together, or a known synchronization method, when the relationship depends on timing.

## Add a math channel

1. Open the actions menu and select **Math channels…**, or select **ƒx** at the end of the channel bar.
2. Select **Add channel**, then enter a name and an expression.
3. Choose the axis (**L** for left or **R** for right) and select **Save**.

Expressions use case-sensitive channel names, the operators `+`, `-`, `*`, and `/`, parentheses, and these functions:

| Expression | Result |
| - | - |
| `voltage * current` | Power, when the inputs are volts and amps. |
| `lowpass(temperature, 5)` | A 5 Hz low-pass filter. `highpass(x, hz)` filters the other way. |
| `moving_avg(current, 20)` | A 20-sample moving average. |
| `ema(current, 0.1)` | An exponential moving average with a smoothing factor of 0.1. |
| `median(current, 5)` | A 5-sample median. |
| `derivative(position)` | Rate of change per second. |
| `integral(power)` | Running total over time. Watts accumulate to joules. |
| `rolling_rms(current, 50)` | RMS over the last 50 samples. `rolling_mean`, `rolling_std`, `rolling_min`, `rolling_max`, and `rolling_p2p` work the same way. |
| `abs`, `sqrt`, `pow`, `exp`, `log`, `min`, `max` | Standard math functions. |

Filter settings, such as a cutoff frequency or window size, must be plain numbers. Expressions can't run arbitrary code.

A missing input leaves a gap in the math channel. Saving changes to math channels restarts their filter history. If two attached ports send the same channel name, a math channel can read either one, so plot one port or give the channels distinct names.

## Save a result

Select **Export CSV** from the actions menu while the source is still attached. If several ports are active, Inlay asks which one to export, then asks where to save the file.

Each recording is also kept in the project's `.inlay/plots/` folder. To reopen one, select the **Previous sessions** button in the toolbar and choose the recording. Inlay keeps the 50 most recent recordings and deletes older ones, so export a recording you need to keep.

Record the firmware revision, workload, and units alongside measurements you plan to compare.

For a combined display with controls and logs, create a [project dashboard](/docs/core-concepts/dashboards.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.