Skip to main content
This tutorial shows how to create a lap-by-lap delta comparison between two drivers. The chart shows who was faster on each lap and by how much. It also shows performance trends across a race. Lap time delta comparison showing VER vs LEC at Monaco 2024

Setup

Load Session and Get Lap Data

Calculate Time Deltas

Convert lap times to seconds and calculate the difference for each lap.

Color Code by Faster Driver

Assign colors based on which driver was faster on each lap.

Create the Bar Chart

Visualize the deltas with a bar chart where bar height shows the time difference.

Add Legend and Styling

Complete Example

The whole workflow above is wrapped in a single native function:
Bars below zero mean the first driver was faster; bars above zero mean the second driver was faster. The y-axis auto-scales to the data instead of the hardcoded (-2, 2) used above. Bars are colored with the faster driver’s team color.

Interpreting the Chart

  • Bars above zero: Driver 2 was faster on that lap
  • Bars below zero: Driver 1 was faster on that lap
  • Bar height: Magnitude of the time difference in seconds
  • Color coding: The bar color identifies the faster driver

What to Look For

This visualization helps identify:
  1. Consistency: Who maintains more consistent lap times?
  2. Pace trends: Does one driver get faster or slower as the race progresses?
  3. Tire degradation: Increasing deltas may indicate tire wear
  4. Strategy impact: How do pit stops affect relative performance?
  5. Traffic effects: Sudden spikes often indicate traffic or incidents

Filtering Out Outliers

The native function exposes the same filters as parameters. Drop pit laps with include_pit_laps=False (the default) and remove safety-car laps with a per-driver laptime_cutoff:
Restrict the comparison to specific laps with the laps parameter, for example laps=[10, 11, 12].

Comparing Multiple Driver Pairs

To compare different pairs, call the native function with a different drivers list:

Summary

Lap delta comparisons give a clear, lap-by-lap view of relative performance between drivers. The chart shows patterns, consistency differences, and the effect of race events on driver performance.

Driver Lap Times

Individual driver analysis.

Telemetry Comparison

Detailed telemetry analysis.

Race Pace Analysis

Compare race pace.

Position Changes

Track position changes.
Last modified on September 3, 2026