Spaces:
Running
Running
Update functions/PitchPlotFunctions.py
Browse files
functions/PitchPlotFunctions.py
CHANGED
|
@@ -562,7 +562,7 @@ class PitchPlotFunctions:
|
|
| 562 |
self.plot_logo(pitcher_id=pitcher_id, ax=ax_logo)
|
| 563 |
|
| 564 |
# Create subplot for the main plot
|
| 565 |
-
ax_main_plot = fig.add_subplot(gs[2,
|
| 566 |
|
| 567 |
# Create subplot for the legend
|
| 568 |
ax_legend = fig.add_subplot(gs[3, :])
|
|
@@ -571,13 +571,13 @@ class PitchPlotFunctions:
|
|
| 571 |
# Create subplot for the footer
|
| 572 |
ax_footer = fig.add_subplot(gs[-2, :])
|
| 573 |
|
| 574 |
-
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
-
|
| 579 |
-
|
| 580 |
-
|
| 581 |
|
| 582 |
# Sort the DataFrame and get unique pitch types
|
| 583 |
items_in_order = list(df.sort(by=['prop', 'pitch_type'], descending=[True, True])['pitch_type'].unique(maintain_order=True))
|
|
|
|
| 562 |
self.plot_logo(pitcher_id=pitcher_id, ax=ax_logo)
|
| 563 |
|
| 564 |
# Create subplot for the main plot
|
| 565 |
+
ax_main_plot = fig.add_subplot(gs[2, 1:-1])
|
| 566 |
|
| 567 |
# Create subplot for the legend
|
| 568 |
ax_legend = fig.add_subplot(gs[3, :])
|
|
|
|
| 571 |
# Create subplot for the footer
|
| 572 |
ax_footer = fig.add_subplot(gs[-2, :])
|
| 573 |
|
| 574 |
+
Plot the selected pitch movement plot
|
| 575 |
+
if plot_picker == 'short_form_movement':
|
| 576 |
+
self.break_plot_big(df, ax_main_plot, sport_id=sport_id)
|
| 577 |
+
elif plot_picker == 'long_form_movement':
|
| 578 |
+
self.break_plot_big_long(df, ax_main_plot, sport_id=sport_id)
|
| 579 |
+
elif plot_picker == 'release_point':
|
| 580 |
+
self.release_point_plot(df, ax_main_plot, sport_id=sport_id)
|
| 581 |
|
| 582 |
# Sort the DataFrame and get unique pitch types
|
| 583 |
items_in_order = list(df.sort(by=['prop', 'pitch_type'], descending=[True, True])['pitch_type'].unique(maintain_order=True))
|