F1 Telemetry & Race Analysis Tool
A config-driven Python notebook for visualising Formula 1 session data — telemetry traces, tyre strategy, lap distributions, weather overlays and more — built on FastF1 and matplotlib
A personal project born out of wanting to go beyond broadcast graphics and actually dig into the raw session data that FastF1 exposes. Point it at any race, qualifying or practice session, pick your drivers, and a single “main()” call produces up to 10 publication-quality plots in a consistent dark (or light) monospace theme. Still a work in progress that I plan to make into a one stop analysis platform with connections to live data. Similar to F1 Multiviewer but more race engineering oriented. Kind of a homemade verison of Racewatch if you will.
SESSION = {"year": 2024, "round": "Bahrain", "session": "R"}
DRIVERS = ["VER", "NOR", "LEC"]
That’s all the configuration needed to get started.
Architecture
The notebook is structured around a central config block (SESSION, DRIVERS, PLOTS, ANNOTATIONS, STYLE) that controls everything: which plots are generated, whether telemetry is loaded at all (skipped if unneeded to save time), and whether figures are saved to disk or rendered inline.
A main() dispatcher then loads the FastF1 session, fetches per-driver lap data, and calls only the enabled plot functions. Each plot function is self-contained and follows the same pattern: make_fig() → build axes → save_or_show().
Key design choices:
- Telemetry is only fetched when at least one telemetry plot is enabled, keeping session load time low for stats-only runs.
- Laps more than 112% of median (safety car, VSC, formation) are stripped automatically before plotting.
- Missing drivers, unavailable telemetry, and missing weather data all produce warnings rather than crashes.
-
TELEMETRY_LAPcan beNone(fastest lap),"all"(every lap overlaid), or a specific lap number.
Plot Gallery
Lap Time Evolution
For Qualifying sessions the chart automatically switches to a horizontal bar chart showing each driver’s best Q1 / Q2 / Q3 time, with colour-coded segments and inline time labels.
All-Laps Speed Overlay
Telemetry Traces — Speed, Throttle/Brake, Gear
Sector Times
Tyre Strategy
Lap Distribution & Delta Trace
Weather Overlay
Usage
pip install fastf1 matplotlib numpy pandas
Open the notebook, set SESSION, DRIVERS, and the PLOTS flags you want, then run all cells. On first load FastF1 downloads and caches the session data; subsequent runs for the same session are instant.
Set STYLE["save_plots"] = True to write all figures as PNGs to ./f1_output/ instead of rendering inline — useful for batch-generating a full race weekend’s worth of charts.
SESSION = {"year": 2024, "round": "Monaco", "session": "Q"}
DRIVERS = ["LEC", "SAI", "VER"]
TELEMETRY_LAP = None # each driver's fastest lap
PLOTS = {"lap_times": True, "speed_trace": True, "sector_times": True, ...}
STYLE = {"theme": "dark", "save_plots": True, "save_dir": "./monaco_quali"}