Skip to main content
These examples demonstrate how to analyze race strategies, tire compounds, position changes, and team performance.

Tire Strategy

Visualize all drivers’ tire strategies throughout a race.

What This Example Shows

  • Grouping laps by driver and stint
  • Calculating stint lengths
  • Using horizontal bars to visualize strategies
  • Color coding by tire compound
  • Ordering drivers by finishing position

Expected Output

A horizontal bar chart showing each driver’s race with colored segments representing different tire compound stints. You can see:
  • How many stops each driver made
  • Which compounds they used and when
  • Stint lengths for each driver
  • Strategic differences between teams

Understanding Stints

A stint is a period of running on the same set of tires. FastF1 automatically numbers stints:
  • Stint 1: Start to first pit stop
  • Stint 2: First pit stop to second pit stop
  • And so on…

Position Changes

Track how driver positions change throughout a race.

What This Example Shows

  • Tracking position changes lap by lap
  • Using driver-specific styling (colors and line styles)
  • Creating an inverted y-axis (position 1 at top)
  • Handling crowded plots with external legends

Expected Output

A line plot showing all drivers’ positions throughout the race. You can observe:
  • Starting grid positions
  • Overtakes and position swaps
  • Pit stop drops
  • Safety car bunching
  • Final finishing order

Performance Optimization

This significantly speeds up loading when you only need lap-by-lap data.

Qualifying Results

Visualize qualifying results with time gaps to pole position.

What This Example Shows

  • Collecting fastest laps for all drivers
  • Calculating time gaps from pole position
  • Creating horizontal bar charts
  • Using team colors for bars
  • Formatting timedelta for display

Expected Output

A horizontal bar chart showing the qualifying results, with bars representing the time gap to pole position. Team colors make it easy to compare teammates.

Team Pace Ranking

Rank teams by race pace using box plots.

What This Example Shows

  • Aggregating laps by team
  • Using box plots to show pace distribution
  • Ordering teams by median pace
  • Customizing box plot styling

Expected Output

A box plot showing each team’s lap time distribution:
  • Box: 25th to 75th percentile (middle 50% of laps)
  • Line in box: Median lap time
  • Whiskers: Extend to show range (excluding outliers)
  • Teams ordered: Fastest (left) to slowest (right)

Understanding Box Plots

  • Narrow box: Consistent pace
  • Wide box: Variable pace (tire deg, traffic, etc.)
  • Lower position: Faster overall pace
  • Outliers: Shown as individual points beyond whiskers

Strategy Analysis Tips

Comparing Strategies

Strategy analysis is most interesting for dry races. Mixed conditions races may show unusual patterns due to weather-driven pit stops.