You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I plot an xG map using soccerShotmap, the locations are appearing as a mirror image as where they should be. I used soccerTransform to adjust the coordinates an all Statsbomb data which fixed a similar issue for soccerPassmap however this seems to have created a new issue for the shot map. Should I be using the normal Statsbomb coordinates in this case (i.e. should I not have used soccerTransform here) or is it an unrelated issue do you think?
Thanks
The text was updated successfully, but these errors were encountered:
StatsBomb reports their x,y-coordinates for both teams as if attacking from left to right, so the shots won't always be the orientation they appeared from the camera angle (i.e. they will appear mirror imaged when a team was attacking from right to left).
If you want to mirror the locations for plotting you could just subtract the y-coordinates from the y maximum (120 if raw StatsBomb coordinates, whatever your widthPitch is if coordinates are transformed). e.g.:
# raw data from StatsBombR (1 < x < 120, 1 < y < 80)fawsl_dat<-d %>%
filter(match_id==19746)
# mirror y-coordsdat<-dat %>%
mutate(location.y=80-location.y)
# transform from StatsBomb x,y-coords to metre unitsdat<-dat %>%
soccerTransform(method="statsbomb")
# plot shotmapdat %>%
filter(team.id==967) %>%
soccerShotmap()
When I plot an xG map using soccerShotmap, the locations are appearing as a mirror image as where they should be. I used soccerTransform to adjust the coordinates an all Statsbomb data which fixed a similar issue for soccerPassmap however this seems to have created a new issue for the shot map. Should I be using the normal Statsbomb coordinates in this case (i.e. should I not have used soccerTransform here) or is it an unrelated issue do you think?
Thanks
The text was updated successfully, but these errors were encountered: