Skip to main content
A lap time heatmap shows race pace across all drivers and laps. Color coding identifies 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
These patterns show tire degradation (gradual color shift), pit stop windows (gaps), and incidents (sudden color changes).

Loading the Session

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 the seaborn heatmap function to draw the chart.

Interpreting the Heatmap

When analyzing a lap time heatmap, look for:
  • Vertical patterns: Consistent colors down a column indicate similar pace across all drivers (for example, 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 compare true pace, apply fuel correction to account for the decreasing fuel load:

Parameters

The native function exposes the same filters as parameters. laptime_cutoff fixes the color scale, from fastest to fastest * cutoff. include_deleted and include_pit_laps keep those laps when True. cmap and xticklabels control the styling:

Complete Example

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

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 September 3, 2026