Skip to main content
A lap time heatmap provides a comprehensive view of race pace across all drivers and laps. By color-coding lap times, you can quickly identify consistent performers, tire degradation patterns, pit stop strategies, and incidents. Lap time heatmap showing race pace patterns

Understanding the visualization

In a lap time heatmap:
  • Rows represent drivers (sorted by average pace)
  • Columns represent lap numbers
  • Colors indicate lap time performance:
    • Green/cooler colors = faster laps
    • Red/warmer colors = slower laps
    • White/missing = pit stops or deleted laps
This makes it easy to spot patterns like tire degradation (gradual color shift), pit stop windows (gaps), and incidents (sudden color changes).

Loading the session

We’ll analyze the 2023 Monaco Grand Prix race to see how drivers performed throughout the event.

Preparing the data

Convert lap times to seconds and filter out invalid laps for cleaner visualization.

Creating the pivot table

Reshape the data so drivers are rows and lap numbers are columns.

Visualizing with seaborn

Use seaborn’s heatmap function for a clean, professional visualization.

Interpreting the heatmap

When analyzing a lap time heatmap, look for:
  • Vertical patterns: Consistent colors down a column indicate similar pace across all drivers (e.g., safety car periods)
  • Horizontal patterns: Gradual color shifts across a row show tire degradation or fuel load effects
  • Gaps: White spaces indicate pit stops
  • Sudden changes: Abrupt color shifts may indicate incidents, traffic, or mistakes
  • Consistent greens: Drivers with predominantly green rows had strong, consistent pace

Adding fuel correction

To better compare true pace, you can apply fuel correction to account for decreasing fuel load:

Complete example

Advanced variations

Compare specific drivers

Focus on a subset of drivers for detailed comparison:

Annotate with lap times

Add actual lap time values to cells for precise analysis:

Next steps

  • Combine with tire strategy visualization to correlate pace with compounds
  • Analyze specific stint performance by filtering lap ranges
  • Compare heatmaps across different races to identify track-specific patterns
  • Use clustering algorithms to group drivers with similar pace profiles
Last modified on March 6, 2026