Skip to main content

matplotsoccer

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 https://github.com/ML-KULeuven/socceraction) 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()

matplotsoccer.actions(
    location=actions[["start_x", "start_y", "end_x", "end_y"]],
    action_type=actions.type_name,
    team=actions.team_name,
    result= actions.result_name == "success",
    label=actions[["time_seconds", "type_name", "player_name", "team_name"]],
    labeltitle=["time","actiontype","player","team"],
    zoom=False
)

(c) Tom Decroos 2019

Release files for matplotsoccer 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for matplotsoccer 0.0.8
File Size Uploaded
matplotsoccer-0.0.8.tar.gz 5.6 kB Details

Release files / matplotsoccer-0.0.8.tar.gz

Download URL matplotsoccer-0.0.8.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
547a68dc4a4b5c513772039e78243a52036823adb835d4219f87774d8c8e44b1
BLAKE2b-256 checksum
How to use checksums
7127fbe1ee8008fd03186cfa888b42cb776f675f1a2b1efd255c01b85925dd44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.0.8 This release

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page