Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -751,7 +751,7 @@ def server(input, output, session):
|
|
751 |
title_spot = f'{df_plot.pitcher_name.values[0]}'
|
752 |
|
753 |
|
754 |
-
ax0.text(x=0.5,y=0
|
755 |
ax0.text(x=0.5,y=0.5,s='Game Pitching Summary',fontname='Calibri',ha='center',fontsize=40,va='top',fontstyle='italic')
|
756 |
|
757 |
|
@@ -778,11 +778,12 @@ def server(input, output, session):
|
|
778 |
except urllib.error.HTTPError as err:
|
779 |
url = f'https://img.mlbstatic.com/mlb-photos/image/upload/d_people:generic:headshot:67:current.png/w_213,q_auto:best/v1/people/1/headshot/67/current.png'
|
780 |
imagebox = OffsetImage(test_mage, zoom = 0.5)
|
781 |
-
ab = AnnotationBbox(imagebox, (0.125, 0.
|
782 |
ax0.add_artist(ab)
|
783 |
|
784 |
player_bio = requests.get(url=f"https://statsapi.mlb.com/api/v1/people?personIds={pitcher_id_select}&hydrate=currentTeam").json()
|
785 |
|
|
|
786 |
|
787 |
|
788 |
|
@@ -796,7 +797,7 @@ def server(input, output, session):
|
|
796 |
# im = plt.imread(team_logos[team_logos['id'] == player_bio['people'][0]['currentTeam']['parentOrgId']]['imageLink'].values[0])
|
797 |
# ax = fig.add_axes([0,0,1,0.85], anchor='C', zorder=1)
|
798 |
imagebox = OffsetImage(im, zoom = 0.4)
|
799 |
-
ab = AnnotationBbox(imagebox, (0.875, 0.
|
800 |
ax0.add_artist(ab)
|
801 |
except IndexError:
|
802 |
print()
|
|
|
751 |
title_spot = f'{df_plot.pitcher_name.values[0]}'
|
752 |
|
753 |
|
754 |
+
ax0.text(x=0.5,y=1.0,s=title_spot,fontname='Calibri',ha='center',fontsize=56,va='top')
|
755 |
ax0.text(x=0.5,y=0.5,s='Game Pitching Summary',fontname='Calibri',ha='center',fontsize=40,va='top',fontstyle='italic')
|
756 |
|
757 |
|
|
|
778 |
except urllib.error.HTTPError as err:
|
779 |
url = f'https://img.mlbstatic.com/mlb-photos/image/upload/d_people:generic:headshot:67:current.png/w_213,q_auto:best/v1/people/1/headshot/67/current.png'
|
780 |
imagebox = OffsetImage(test_mage, zoom = 0.5)
|
781 |
+
ab = AnnotationBbox(imagebox, (0.125, 0.6), frameon = False)
|
782 |
ax0.add_artist(ab)
|
783 |
|
784 |
player_bio = requests.get(url=f"https://statsapi.mlb.com/api/v1/people?personIds={pitcher_id_select}&hydrate=currentTeam").json()
|
785 |
|
786 |
+
ax0.text(x=0.5,y=0.7,s=f"{ player_bio['people'][0]['pitchHand']['code']}HP, Age: {player_bio['people'][0]['currentAge']}, {player_bio['people'][0]['height']}/{player_bio['people'][0]['weight']}",fontname='Calibri',ha='center',fontsize=24,va='top')
|
787 |
|
788 |
|
789 |
|
|
|
797 |
# im = plt.imread(team_logos[team_logos['id'] == player_bio['people'][0]['currentTeam']['parentOrgId']]['imageLink'].values[0])
|
798 |
# ax = fig.add_axes([0,0,1,0.85], anchor='C', zorder=1)
|
799 |
imagebox = OffsetImage(im, zoom = 0.4)
|
800 |
+
ab = AnnotationBbox(imagebox, (0.875, 0.6), frameon = False)
|
801 |
ax0.add_artist(ab)
|
802 |
except IndexError:
|
803 |
print()
|