Wanted to add a colorbar to the plot, but get the following error :
AttributeError: 'AxesSubplot' object has no attribute 'get_array'
Code is a bit long, but below is a snippet.
pitch = Pitch(pitch_type='statsbomb', orientation='horizontal',
pitch_color='#000000', line_color='#5c5c5c', figsize=(16, 11),
tight_layout=True, goal_type='box')
fig, ax = pitch.draw()
img = sns.scatterplot(x='vertical', y='horizontal', data=game_data, hue='PV', s=markersize,
marker=markerstyle, legend=False, palette=color_palette,
linewidth=markeredgewidth, ax=ax)
fig.colorbar(img, ax=ax)
Wanted to add the colorbar on the side
Could anyone help? Thanks