Beispiel #1
0
title = dict(
    title_name='RGB-G+Seg(100k)',
    title_color='#B6282F',
    subtitle_name='Early Fusion',
    subtitle_color='#B6282F',
    title_name_2='RGB-G+Seg(224K)',
    title_color_2='#0098A1',
    subtitle_name_2='Early Fusion',
    subtitle_color_2='#0098A1',
    title_fontsize=18,
    subtitle_fontsize=15,
)

## endnote 
#endnote = "Visualization made by: Anmol Durgapal(@slothfulwave612)\nAll units are in per90"

fig, ax = plt.subplots(figsize=(10, 8))

## instantiate object 
radar = Radar()

## plot radar -- alphas
fig, ax = radar.plot_radar(ranges=ranges, params=params, values=values, 
                                 radar_color=['#B6282F', '#0098A1'], 
                                 alphas=[0.8, 0.6], title=title,
                                 compare=True,figax=(fig,ax), dpi=300)

plt.show()


Beispiel #2
0
                               df['Player'].sort_values(ascending=True)))

#categories = st.multiselect('Choose categories',list(df.columns[10:31]),list(df.columns[10:13]))

#player1 = st.selectbox("Player 1:",options=list(df['Player'].sort_values(ascending=True)) )
#player2 = st.selectbox("Player 2:",options=list(df['Player'].sort_values(ascending=True)) )

valuerange = []

for x in categories:
    #df[x] = df[x].astype('float64',errors='ignore')
    valuerange.append(
        (min(df[df['Min'] > 300][x]), max(df[df['Min'] > 300][x]) * 1.1))

radar = Radar(background_color="#0E1117",
              patch_color="#535353",
              label_color="#FFFFFF",
              range_color="#FFFFFF")

title = dict(
    title_name=str(df.iloc[df[df['Player'].str.contains(player1) ==
                              True].index[0]]['Player']).split('\\')[0],
    title_color='#B6282F',
    subtitle_name=str(df.iloc[df[df['Player'].str.contains(player1) ==
                                 True].index[0]]['Min']) + ' minutes',
    subtitle_color='#B6282F',
    title_name_2=str(df.iloc[df[df['Player'].str.contains(player2) ==
                                True].index[0]]['Player']).split('\\')[0],
    title_color_2='#344D94',
    subtitle_name_2=str(df.iloc[df[df['Player'].str.contains(player2) ==
                                   True].index[0]]['Min']) + ' minutes',
    subtitle_color_2='#344D94',
              title_color='#CC071E',
              subtitle_name='CCE DS3',
              subtitle_color='#000000',
              title_name_2='Separate NN',
              title_color_2='#407FB7',
              subtitle_name_2='CCE DS3',
              subtitle_color_2='#000000',
              title_fontsize=18,
              subtitle_fontsize=15)
## endnote
#endnote = "Visualization made by: Anmol Durgapal(@slothfulwave612)\nAll units are in per90"

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 10))

## instantiate object
radar = Radar()

## plot radar -- alphas
fig, ax1 = radar.plot_radar(ranges=ranges,
                            params=params,
                            values=values,
                            radar_color=['#CC071E', '#407FB7'],
                            alphas=[0.7, 0.6],
                            title=title,
                            compare=True,
                            figax=(fig, ax1),
                            dpi=300)

fig, ax2 = radar.plot_radar(ranges=ranges,
                            params=params,
                            values=values1,
    a = a - (a * 1.0)

    b = max(player_data[params][x])
    b = b + (b * 1.0)

    ranges.append((a, b))

#Getting player stats- values
values = []
for idx, _ in player_data.iterrows():
    values.append(player_data.loc[idx].values.tolist())

#Assigning title to the plot
title = dict(title_name='Jamie Vardy',
             title_color='blue',
             title_name_2='Alexander Isak',
             title_color_2='Red',
             title_fontsize=18)
endnote = '@amod\ndata via FBREF / Statsbomb'

#Potting the radar chart
radar = Radar()
fig, ax = radar.plot_radar(ranges=ranges,
                           params=params,
                           values=values,
                           radar_color=['blue', 'red'],
                           alphas=[.5, .7],
                           endnote=endnote,
                           title=title,
                           compare=True)