Untitled

 avatar
unknown
plain_text
10 months ago
1.4 kB
5
Indexable
import matplotlib.pyplot as plt
import matplotlib.patches as patches

# Create a figure
fig, ax = plt.subplots(figsize=(10, 6))

# Define the positions for the upper and lower bracket matches
upper_bracket_positions = [(1, 9), (2, 8), (3, 7), (3.5, 6), (4, 5)]
lower_bracket_positions = [(1, 4), (2, 3), (3, 2), (4, 1)]

# Upper bracket matches
upper_bracket_matches = [
    "Team 1 vs Team 2",
    "Team 3 vs Team 4",
    "Team 5 vs Team 6",
    "Winner Match 2 vs Winner Match 3",
    "Winner Match 1 vs Winner of Match 4"
]

# Lower bracket matches
lower_bracket_matches = [
    "Loser Match 1 vs Loser Match 2",
    "Loser Match 3 vs Winner Lower 1",
    "Loser of UB Semifinal vs Winner Lower 2",
    "Lower Bracket Final"
]

# Plot the upper bracket
for idx, match in enumerate(upper_bracket_matches):
    ax.text(upper_bracket_positions[idx][0], upper_bracket_positions[idx][1], match,
            ha='center', va='center', fontsize=10, bbox=dict(facecolor='lightblue', edgecolor='black'))

# Plot the lower bracket
for idx, match in enumerate(lower_bracket_matches):
    ax.text(lower_bracket_positions[idx][0], lower_bracket_positions[idx][1], match,
            ha='center', va='center', fontsize=10, bbox=dict(facecolor='lightgreen', edgecolor='black'))

# Draw lines connecting the matches
for i in range(2):
    ax.add_patch(patches.FancyArrowPatch((upper_bracket_positions[i][0]+0.5, upper_bracket_positions[i
Editor is loading...
Leave a Comment