Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
F1 Overtake Analyser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lennard Geese
F1 Overtake Analyser
Commits
049c1042
Commit
049c1042
authored
1 month ago
by
Lennard Geese
Browse files
Options
Downloads
Patches
Plain Diff
Clean up
parent
d74335cb
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DataPlotter.py
+6
-18
6 additions, 18 deletions
DataPlotter.py
with
6 additions
and
18 deletions
DataPlotter.py
+
6
−
18
View file @
049c1042
...
...
@@ -12,26 +12,22 @@ from DataHandler import DataHandler
# TODO: Adjust input parameters for multiple weather change windows
class
DataPlotter
(
DataHandler
):
def
plotOvertakesWithTireChangeWindow
(
self
,
overtakesPerLap
:
list
[
int
],
firstTireChange
:
int
,
lastTireChange
:
int
,
raceName
:
str
):
# TODO: Account for cases where no tire changes (meaning values of 0 or -1)
# TODO: Let visualization start at 0, but graph at 1
# Adjust values
#overtakesPerLap.insert(0, 0) # Insert 0th lap, which cannot have overtakes
firstTireChange
-=
1
lastTireChange
+=
1
# Define variables
laps
:
int
=
len
(
overtakesPerLap
)
plt
.
xlim
(
0
,
laps
+
1
)
# set x-range of plot
axis
=
plt
.
gca
()
# Set x-range of plot
plt
.
xlim
(
0
,
laps
+
1
)
# Define data range
x_values
=
np
.
arange
(
1
,
laps
+
1
)
plt
.
plot
(
x_values
,
overtakesPerLap
)
axis
=
plt
.
gca
()
# Paint background between first and last tire change
axis
.
axvspan
(
firstTireChange
,
lastTireChange
,
color
=
'
blue
'
,
alpha
=
0.3
)
# Label stuff
axis
.
set_xlabel
(
'
Lap
'
)
...
...
@@ -53,14 +49,6 @@ class DataPlotter(DataHandler):
axis
.
grid
(
which
=
'
minor
'
,
alpha
=
0.2
)
axis
.
grid
(
which
=
'
major
'
,
alpha
=
0.5
)
# Add legend
axis
.
legend
(
bbox_to_anchor
=
(
1.0
,
1.02
))
# Paint background between the first and last tire change
axis
.
axvspan
(
firstTireChange
,
lastTireChange
,
color
=
'
blue
'
,
alpha
=
0.3
)
plt
.
tight_layout
()
plt
.
show
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment