Closed JackMentch closed 1 year ago
Hey Brayan, I'm cool with whatever you think is best! Thank you for taking a look as well!
This is really nice! Sorry for the delay
I would suggest that we either throw an error when missing that is more informative, or can we fall back to text for missing team codes?
Hi Moshe,
I appreciate your response! Just made a new commit that plots text (team abbreviation) instead of the logo if it cannot find a corresponding image. Let me know if this looks fine:
Yeah, this is a great fallback!
Description
I added the function
plot_teams( )
to pybaseball/plotting.py so that you can easily plot all teams against any two variables in a dataframeRationale
The two functions
team_pitching( )
andteam_batting( )
both return stats for all 30 teams.For example,
Running
team_batting(2023)
would return a dataframe similar to this...Using my function
plot_teams( )
you could plot each team's total HRs and BBs for 2023This would generate the following plot:
Limitations: