Skip to main content

Library for visualizing soccer event stream data

Project description


This is a package to visualize soccer data

To install it simply

pip install matplotsoccer

The most important functions are

  1. Plotting a field with matplotsoccer.field():

  1. Plotting a heatmap with matplotsoccer.heatmap(matrix)

  1. Plotting soccer event stream data. Here is an example of five actions in the SPADL format (see leading up to Belgium's second goal against England in the third place play-off in the 2018 FIFA world cup.
game_id period_id seconds team player start_x start_y end_x end_y actiontype result bodypart
8657 2 2179 Belgium Axel Witsel 37.1 44.8 53.8 48.2 pass success foot
8657 2 2181 Belgium Kevin De Bruyne 53.8 48.2 70.6 42.2 dribble success foot
8657 2 2184 Belgium Kevin De Bruyne 70.6 42.2 87.4 49.1 pass success foot
8657 2 2185 Belgium Eden Hazard 87.4 49.1 97.9 38.7 dribble success foot
8657 2 2187 Belgium Eden Hazard 97.9 38.7 105 37.4 shot success foot

Here is the phase visualized using matplotsoccer.actions()

    location=actions[["start_x", "start_y", "end_x", "end_y"]],
    result= actions.result_name == "success",
    label=actions[["time_seconds", "type_name", "player_name", "team_name"]],

(c) Tom Decroos 2019

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for matplotsoccer, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size matplotsoccer-0.0.8.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page