I added the function plot_strike_zone() to pybaseball/plotting.py so that folks can plot pitch charts in an similar way to the spray charts that already exist
relatedly, I added to the pitch_code_to_name_map in pybaseball/utils.py to account for new pitch types this year, (e.g. Sweeper)
Example Usage
from pybaseball.plotting import plot_strike_zone
from pybaseball import statcast_pitcher
data = statcast_pitcher('2022-09-03', '2022-09-03', 656302)
plot_strike_zone(data.loc[data["pitch_type"] == "SL"], title = "Exit Velocities on Dylan Cease's Slider", colorby='description', annotation="launch_speed")
Limitations
there is nothing to prevent users from trying to use any column as an annotation on the plot, even when it may not fit on the marker
Description
I added the function
plot_strike_zone()
topybaseball/plotting.py
so that folks can plot pitch charts in an similar way to the spray charts that already existpitch_code_to_name_map
inpybaseball/utils.py
to account for new pitch types this year, (e.g. Sweeper)Example Usage
Limitations