plot_lap_times
Plot lap times against lap number for up to three drivers, with tyre-compound markers, to compare race pace and spot degradation or safety-car phases. Returns a PNG chart.
Instructions
Plot lap time against lap number for up to three drivers, with marker shape showing the tyre compound. Returns a PNG image.
Use for "show me the race pace of X vs Y", "plot their lap times", or to visualise degradation and safety-car phases.
Args:
year: Season year (2018+)
event: Race name or round number
session: Session type (default "R")
drivers: Up to 3 driver codes. Default: the top three finishers.
save_path: If True, also write the PNG to the export directory
(default ./fastf1-exports/); a string is a directory or
a full .png path.
Note: Lap 1, in/out laps and laps slower than 107% of the driver's median (safety car, incidents) are omitted so the y-axis stays readable; the caption reports how many slow laps were dropped and the line breaks across every omitted lap.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"year": "<year>",
"event": "<event>"
},
"name": "plot_lap_times"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | ||
| event | Yes | ||
| drivers | No | ||
| session | No | R | |
| save_path | No |