Skip to main content
This tutorial shows how to create a scatter plot of driver lap times throughout a race. The color coding is based on the tire compounds used. This visualization helps identify tire performance, consistency, and strategy effectiveness. Driver lap times scatter plot showing Alonso's lap times in the 2023 Azerbaijan Grand Prix

Setup

Load the Race Session

Get Driver Laps

Filter laps for a specific driver and remove slow laps that would distort the visualization.

Create the Scatter Plot

Make a scatter plot using lap number as the x-axis and lap time as the y-axis. Marker colors correspond to the tire compounds used.

Enhance the Plot

Improve the appearance and readability of the plot.

Parameters

The native function exposes the same filters as parameters. drivers selects the drivers to plot: a single driver for the view above, or several. laptime_cutoff removes slow laps. include_deleted keeps deleted laps when True:

Complete Example

The whole workflow above is wrapped in a single native function:

Analyzing Multiple Drivers

To compare several drivers, pass them all in the drivers list. The native default is the top-3 finishers, so omitting drivers gives exactly the multi-driver view:

Insights from the Visualization

This type of plot reveals several insights:
  1. Tire Performance: Different compounds show distinct lap time clusters
  2. Degradation: Upward trends within a compound indicate tire wear
  3. Consistency: Tight clustering shows consistent driving
  4. Strategy: Compound changes and their timing are clearly visible
  5. Outliers: Slow laps (traffic, mistakes) stand out immediately

Customization Options

Customize the plot further:

Summary

This tutorial shows how to create a lap time visualization. The plot combines temporal data (lap number), performance data (lap time), and strategic information (tire compound). The scatter plot format shows patterns, outliers, and strategic decisions clearly throughout a race.

Tire Strategy

Detailed tire analysis.

Race Pace Analysis

Compare race pace.

Plotting API

Plotting reference.

Complete Race Analysis

Full race workflow.
Last modified on September 3, 2026