Skip to main content
This tutorial shows how to create a scatter plot of a driver’s lap times throughout a race, with color coding based on 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

Make the plot more aesthetic and easier to read.

Complete Example

Here’s the full code in one block:

Analyzing Multiple Drivers

You can extend this to compare multiple drivers side by side:

Insights from the Visualization

This type of plot reveals several key 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

You can customize the plot further:

Summary

This tutorial demonstrated how to create an effective lap time visualization that combines temporal data (lap number) with performance data (lap time) and strategic information (tire compound). The scatter plot format makes it easy to spot patterns, outliers, and strategic decisions 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 March 6, 2026