# Plot a sample recording

bsln version: `0.0.1b40`

SDK source: `baseline-robotics/engineering@c8db8d9fbc8ce8e0524c5ee45cebdfcec34fc666:robotics/bsln`

Page source: `baseline-robotics/engineering@c8db8d9fbc8ce8e0524c5ee45cebdfcec34fc666:robotics/bsln/docs/customer/OFFLINE.md`

[Read on the web](https://docs.baseline-robotics.com/recipes/explore-recording/) | [Markdown](https://docs.baseline-robotics.com/recipes/explore-recording.md) | [Documentation index](https://docs.baseline-robotics.com/llms.txt)

This tutorial uses a synthetic six-second episode with 181 rows. `joint1` is in radians and `gripper` uses normalized positions. Run the example locally with [uv](https://docs.astral.sh/uv/getting-started/installation/) and Python 3.10 or newer.

## 1. Download the sample and script

In an empty directory, download the [sample recording](https://docs.baseline-robotics.com/downloads/recording/sample-recording.zip) and the plotting script, then extract the ZIP:

```bash
curl -fsSLO https://docs.baseline-robotics.com/downloads/recording/sample-recording.zip &&
curl -fsSLO https://docs.baseline-robotics.com/downloads/recording/plot_joint.py &&
uv run --no-project python -m zipfile -e sample-recording.zip .
```

## 2. Make the plot

```bash
uv run --no-project plot_joint.py synthetic-episode joint1 --out joint1.svg
```

The first run installs PyArrow and Matplotlib. The script prints `Read 181 rows over 6.000 s (rad); saved joint1.svg`. Open `joint1.svg` in a browser or compare it with the [reference plot](https://docs.baseline-robotics.com/downloads/recording/expected-joint1.png).

## 3. Read the columns

At zero-based row 54, the timestamp is 1.8 seconds and the requested, permitted and measured positions are 0.800000, 0.333333 and 0.295239 rad. The sample row has the `rate_limited` flag. Use the [column definitions](https://docs.baseline-robotics.com/recordings.md#step-data) to interpret the traces and the [chart data](https://docs.baseline-robotics.com/downloads/recording/recording-view.json) to inspect the underlying rows.

## Use your own episode

<a id="reproduce-the-sample"></a>

From the directory that contains `plot_joint.py`, enter an episode directory and a joint listed in its `meta.json`:

```bash
bash -c '
read -r -p "Episode directory: " episode || exit 1
read -r -p "Joint name: " joint || exit 1
[[ -d $episode && -n $joint ]] && uv run --no-project plot_joint.py "$episode" "$joint" --out joint.svg
'
```

The plot leaves null values as gaps. The [sample generator](https://docs.baseline-robotics.com/downloads/recording/make_sample.py) recreates the synthetic archive.
