Skip to main content
FastF1’s plotting module provides tools for creating professional-looking F1 visualizations with official team colors, driver-specific styling, and matplotlib integration.

Setup Matplotlib

Before creating visualizations, configure matplotlib for optimal F1 data plotting:

Setup Options

  • mpl_timedelta_support: Enables proper formatting of lap times and time deltas on plot axes. Essential for plotting LapTime, sector times, and other timedelta values.
  • color_scheme: Set to 'fastf1' for the signature dark theme with optimized colors, or None for default matplotlib styling.

Team Colors

FastF1 automatically provides official F1 team colors for any session:

Using Team Colors in Plots

Driver Styling

Apply consistent driver-specific colors and line styles to plots:

Sorted Driver Legends

Automatically sort legend entries by team and driver order:

Custom Driver Styles

Define custom styling variants while keeping official team colors:
The magic keyword 'auto' is replaced with the official team color automatically.

Tire Compound Colors

Visualize tire strategies with official compound colors:

Tire Strategy Visualization

Telemetry Visualization

Speed Traces

Gear Visualization on Track Map

Available Plotting Functions

FastF1’s plotting module provides these key functions:

Best Practices

  1. Always call setup_mpl() before creating plots
  2. Enable timedelta support when plotting lap times: setup_mpl(mpl_timedelta_support=True)
  3. Pass the session object to color/style functions for accurate season data
  4. Use pick_quicklaps() to filter outlier lap times before visualization
  5. Invert Y-axis for time-based plots so faster times appear at the top
  6. Use official colors via get_team_color() and get_driver_style() for professional appearance

Next Steps