Skip to content
Discussion options

You must be logged in to vote

Plotting with a break in the axis is a bit of a pain in matplotlib but that's probably the cleanest solution

For something quick and easy, use 'get_laps' or similar to break up the laps. Then make two separate plot calls. You can keep the line style consistent by getting the style from Fastf1. As for making sure you do not have duplicate legends, this guide may be relevant.

I also use the following more general code in my own project:

# Add legend to the current plot after deduplicating labels.

# Useful when labelled elements are added one-by-one, such as when showing SC periods.

handles, labels = ax.get_legend_handles_labels()
if labels:
    deduplicate_labels_handles = dict(zip(labels…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by theOehrly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants