I have two plots. One is a plot of ten basketball players' paths and because of the coordinate system is scaled to a roughly 50x50 graph. The other is of some basketball half-court plotting code that I found online that is plotting on a roughly 500x500 graph scale. I want to superimpose the players' paths plot on top of the basketball court but obviously the current court plotted makes the basketball players' paths look miniscule. How do I effectively scale down or compress the court into a 50x50 graph?
What I have tried:
I've tried changing the coordinates for the basketball half-court function I found below, but I end up messing it up and find it really tedious:
def draw_court(ax=None, color='black', lw=2, outer_lines=False):
if ax is None:
ax = plt.gca()
hoop = Circle((250, 55), radius=7.5, linewidth=lw, color=color, fill=False)
backboard = Rectangle((220, 47.5), 60, -1, linewidth=lw, color=color)
outer_box = Rectangle((160, 0), 160, 190, linewidth=lw, color=color,
fill=False)
inner_box = Rectangle((190, 0), 120, 190, linewidth=lw, color=color,
fill=False)
top_free_throw = Arc((250, 190), 120, 120, theta1=0, theta2=180,
linewidth=lw, color=color, fill=False)
bottom_free_throw = Arc((250, 190), 120, 120, theta1=180, theta2=0,
linewidth=lw, color=color, linestyle='dashed')
restricted = Arc((250, 47.5), 80, 80, theta1=0, theta2=180, linewidth=lw,
color=color)
corner_three_a = Rectangle((30, 0), 0, 140, linewidth=lw,
color=color)
corner_three_b = Rectangle((470, 0), 0, 140, linewidth=lw, color=color)
three_arc = Arc((250, 47.5), 475, 475, theta1=22, theta2=158, linewidth=lw,
color=color)
center_outer_arc = Arc((250, 470), 120, 120, theta1=180, theta2=0,
linewidth=lw, color=color)
center_inner_arc = Arc((250, 470), 40, 40, theta1=180, theta2=0,
linewidth=lw, color=color)
court_elements = [hoop, backboard, outer_box, inner_box, top_free_throw,
bottom_free_throw, restricted, corner_three_a,
corner_three_b, three_arc, center_outer_arc,
center_inner_arc]
if outer_lines:
outer_lines = Rectangle((0, 0), 500, 470, linewidth=lw,
color=color, fill=False)
court_elements.append(outer_lines)
for element in court_elements:
ax.add_patch(element)
return ax