nesticot commited on
Commit
7486baf
·
verified ·
1 Parent(s): 2e22a06

Update functions/PitchPlotFunctions.py

Browse files
Files changed (1) hide show
  1. functions/PitchPlotFunctions.py +13 -0
functions/PitchPlotFunctions.py CHANGED
@@ -370,12 +370,25 @@ class PitchPlotFunctions:
370
  ax.invert_xaxis()
371
  ax.text(24.5, -24.5, s='← Arm Side', fontstyle='italic', ha='left', va='bottom', bbox=dict(facecolor='white', edgecolor='black'), fontsize=13, zorder=3)
372
  ax.text(-24.5, -24.5, s='Glove Side →', fontstyle='italic', ha='right', va='bottom', bbox=dict(facecolor='white', edgecolor='black'), fontsize=13, zorder=3)
 
 
 
 
 
 
 
373
 
 
 
 
374
  # Set aspect ratio and format tick labels
375
  ax.set_aspect('equal', adjustable='box')
376
  ax.xaxis.set_major_formatter(FuncFormatter(lambda x, _: int(x)))
377
  ax.yaxis.set_major_formatter(FuncFormatter(lambda x, _: int(x)))
378
 
 
 
 
379
  ### BREAK PLOT ###
380
  def break_plot_big_long(self, df: pl.DataFrame, ax: plt.Axes, sport_id: int):
381
  """
 
370
  ax.invert_xaxis()
371
  ax.text(24.5, -24.5, s='← Arm Side', fontstyle='italic', ha='left', va='bottom', bbox=dict(facecolor='white', edgecolor='black'), fontsize=13, zorder=3)
372
  ax.text(-24.5, -24.5, s='Glove Side →', fontstyle='italic', ha='right', va='bottom', bbox=dict(facecolor='white', edgecolor='black'), fontsize=13, zorder=3)
373
+ # # After setting limits
374
+ # ax.set_xlim((-25, 25))
375
+ # ax.set_ylim((-25, 25))
376
+
377
+ # Add these lines to ensure proper clipping
378
+ ax.set_clip_on(True)
379
+ ax.patch.set_clip_on(True)
380
 
381
+ # Ensure all plot elements are clipped
382
+ for child in ax.get_children():
383
+ child.set_clip_on(True)
384
  # Set aspect ratio and format tick labels
385
  ax.set_aspect('equal', adjustable='box')
386
  ax.xaxis.set_major_formatter(FuncFormatter(lambda x, _: int(x)))
387
  ax.yaxis.set_major_formatter(FuncFormatter(lambda x, _: int(x)))
388
 
389
+
390
+
391
+
392
  ### BREAK PLOT ###
393
  def break_plot_big_long(self, df: pl.DataFrame, ax: plt.Axes, sport_id: int):
394
  """