Skip to content

Commit 49e8983

Browse files
committed
Run black on plotting script.
1 parent b9b00a2 commit 49e8983

File tree

1 file changed

+14
-12
lines changed
  • docs/tutorials/getting_started/_static/running_axelrods_first_tournament

1 file changed

+14
-12
lines changed

docs/tutorials/getting_started/_static/running_axelrods_first_tournament/main.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,35 @@
55
import axelrod as axl
66
import matplotlib.pyplot as plt
77

8-
first_tournament_participants_ordered_by_reported_rank = [s() for s in axl.axelrod_first_strategies]
9-
number_of_strategies = len(first_tournament_participants_ordered_by_reported_rank)
8+
first_tournament_participants_ordered_by_reported_rank = [
9+
s() for s in axl.axelrod_first_strategies
10+
]
11+
number_of_strategies = len(
12+
first_tournament_participants_ordered_by_reported_rank
13+
)
1014
axl.seed(0)
1115
tournament = axl.Tournament(
12-
players=first_tournament_participants_ordered_by_reported_rank,
13-
turns=200,
14-
repetitions=5
16+
players=first_tournament_participants_ordered_by_reported_rank,
17+
turns=200,
18+
repetitions=5,
1519
)
1620
results = tournament.play()
1721

1822
plt.figure(figsize=(15, 6))
1923
plt.plot((0, 15), (0, 15), color="grey", linestyle="--")
20-
for original_rank, strategy in enumerate(first_tournament_participants_ordered_by_reported_rank):
24+
for original_rank, strategy in enumerate(
25+
first_tournament_participants_ordered_by_reported_rank
26+
):
2127
rank = results.ranked_names.index(str(strategy))
2228
if rank == original_rank:
2329
symbol = "+"
2430
plt.plot((rank, rank), (rank, 0), color="grey")
2531
else:
2632
symbol = "o"
2733
plt.scatter([rank], [original_rank], marker=symbol, color="black", s=50)
28-
plt.xticks(
29-
range(number_of_strategies),
30-
results.ranked_names,
31-
rotation=90
32-
)
34+
plt.xticks(range(number_of_strategies), results.ranked_names, rotation=90)
3335
plt.ylabel("Reported rank")
34-
plt.xlabel("Reproduced rank");
36+
plt.xlabel("Reproduced rank")
3537
plt.savefig("rank_comparison.svg")
3638

3739
plot = axl.Plot(results)

0 commit comments

Comments
 (0)