コード例 #1
0
ファイル: hexbin.py プロジェクト: SwampGuzzler/shotcharts
# plt.axis('off')
# plt.figure(figsize=(12,11))
# plt.figure(figsize=(6,5.5))
# cp3 = plt.hexbin(shot_df.LOC_X, shot_df.LOC_Y, gridsize=[20,7])

joint_shot_chart = sns.jointplot(shot_df.LOC_X, shot_df.LOC_Y, size=7.5, stat_func=None,
                                 kind='hex', space=0, gridsize=[20,6], color=cmap(.2), cmap=cmap)

ax = joint_shot_chart.ax_joint

ax.set_xlim(-250,250)
ax.set_ylim(422.5, -47.5)

# Get rid of axis labels and tick marks
ax.set_xlabel('')
ax.set_ylabel('')
ax.tick_params(labelbottom='off', labelleft='off')
draw_court(ax)
ax.set_title('Chris Paul FGA \n2014-15 Reg. Season', 
             y=0.75, fontsize=18)
ax.add_artist(img)

# draw_court(outer_lines=True)
plt.axis('off')
plt.xlim(-300,300)
plt.ylim(-100,500)
# plt.imshow(paul_pic)

plt.show()

コード例 #2
0
ファイル: browser.py プロジェクト: SwampGuzzler/shotcharts
# joint_shot_chart = sns.jointplot(shot_df.LOC_X, shot_df.LOC_Y, size=7.5, stat_func=None,
#                                  kind='hex', space=0, gridsize=[20,6], color=cmap(.2), cmap=cmap)

# joint_shot_chart = plt.scatter(shot_df.LOC_X, shot_df.LOC_Y)

# ax = joint_shot_chart.ax_joint

# ax.set_xlim(-250,250)
# ax.set_ylim(422.5, -47.5)

# # Get rid of axis labels and tick marks
# ax.set_xlabel('')
# ax.set_ylabel('')
# ax.tick_params(labelbottom='off', labelleft='off')
draw_court()
# ax.set_title('Chris Paul FGA \n2014-15 Reg. Season', 
#              y=0.75, fontsize=18)
# ax.add_artist(img)

# plt.axis('off')
# plt.xlim(-300,300)
# plt.ylim(-100,500)

x = []
for i in shots:
  if i[20] == 0:
    x.append('b')
  else:
    x.append('r')