jldbc / pybaseball

Pull current and historical baseball statistics using Python (Statcast, Baseball Reference, FanGraphs)
MIT License
1.23k stars 330 forks source link

Spraychart mlbstadiums.csv dimensions appear smaller than hc_x and hc_y values suggest #224

Closed corguntu closed 3 years ago

corguntu commented 3 years ago

photo_2021-07-26_00-28-45

sub_data = df_2019[df_2019['events'] == 'triple']
spraychart(sub_data, 'astros', width=700, height=700, title='minutemaid 2019 triples',colorby='launch_speed_angle')

Something I'm missing? max hc_x and hc_y values of triples are roughly 33% greater than the ballpark dimensions contained in mlbstadiums.csv

schorrm commented 3 years ago

This was @andersonfrailey's PR way back when... hm...

schorrm commented 3 years ago

Is it possible that this is just imputed landing -- where it would land if there was no fence or something?

bdilday commented 3 years ago

it looks like maybe the graph you attached doesn;t correpsond to the command you showed? It looks like Fenway, not Minute Maid. Also it looks like you're plotting triples for all teams? Attached is what I get with the following, that filters for home team = HOU,

spraychart(batting_data[batting_data.home_team.str.startswith("HOU")], 'astros', width=700, height=700, title='minutemaid 2019 triples',colorby ='launch_speed_angle')

where batting_data is from this search

minmaid1