Skip to main content

Football pitch plotting library for matplotlib

Reason this release was yanked:

There was a bug in CurvedText for matplotlib 3.8-3.10.

Project description

mplsoccer logo

mplsoccer is a Python library for plotting soccer/football charts in Matplotlib and loading StatsBomb open-data.


Installation

Use the package manager pip to install mplsoccer.

pip install mplsoccer

Or install via Anaconda.

conda install -c conda-forge mplsoccer

Docs

Read more in the docs and see some examples in our gallery.


Quick start

Plot a StatsBomb pitch

from mplsoccer import Pitch
import matplotlib.pyplot as plt
pitch = Pitch(pitch_color='grass', line_color='white', stripe=True)
fig, ax = pitch.draw()
plt.show()

mplsoccer pitch

Plot a Radar

from mplsoccer import Radar
import matplotlib.pyplot as plt
radar = Radar(params=['Agility', 'Speed', 'Strength'], min_range=[0, 0, 0], max_range=[10, 10, 10])
fig, ax = radar.setup_axis()
rings_inner = radar.draw_circles(ax=ax, facecolor='#ffb2b2', edgecolor='#fc5f5f')
values = [5, 3, 10]
radar_poly, rings, vertices = radar.draw_radar(values, ax=ax,
                                               kwargs_radar={'facecolor': '#00f2c1', 'alpha': 0.6}, 
                                               kwargs_rings={'facecolor': '#d80499', 'alpha': 0.6})
range_labels = radar.draw_range_labels(ax=ax)
param_labels = radar.draw_param_labels(ax=ax)
plt.show()

mplsoccer radar


What is mplsoccer?

In mplsoccer, you can:

  • plot football/soccer pitches on nine different pitch types
  • plot radar charts
  • plot Nightingale/pizza charts
  • plot bumpy charts for showing changes over time
  • plot arrows, heatmaps, hexbins, scatter, and (comet) lines
  • load StatsBomb data as a tidy dataframe
  • standardize pitch coordinates into a single format

I hope mplsoccer helps you make insightful graphics faster, so you don't have to build charts from scratch.


Want to help?

I would love the community to get involved in mplsoccer. Take a look at our open-issues for inspiration. Please get in touch at rowlinsonandy@gmail.com or @numberstorm on Twitter to find out more.


Recent changes

View the changelog for a full list of the recent changes to mplsoccer.


Inspiration

mplsoccer was inspired by:


Claude for Open Source

Some mplsoccer development has been helped by Claude Code, with free access generously provided through Anthropic's Claude for Open Source program. If you maintain an open-source project, you can apply at claude.com/open-source-max.


License

MIT

Project details


Download files

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

Source Distribution

mplsoccer-1.7.0.tar.gz (862.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mplsoccer-1.7.0-py3-none-any.whl (98.1 kB view details)

Uploaded Python 3

File details

Details for the file mplsoccer-1.7.0.tar.gz.

File metadata

  • Download URL: mplsoccer-1.7.0.tar.gz
  • Upload date:
  • Size: 862.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.17.1 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"15.1"},"implementation":{"name":"CPython","version":"3.12.13"},"installer":{"name":"hatch","version":"1.17.1"},"openssl_version":"OpenSSL 3.5.7 9 Jun 2026","python":"3.12.13","system":{"name":"Darwin","release":"24.1.0"}} HTTPX2/2.7.0

File hashes

Hashes for mplsoccer-1.7.0.tar.gz
Algorithm Hash digest
SHA256 89ee4fd638993f22fb323bb2cfc00f6e410dbfb48b3b321bb459edf096e75d13
MD5 81afd5660912b77fc1a072e1549d75e1
BLAKE2b-256 98ff949dacf140f5e4f560ef703136bacb39666f9c0fb502a329a569162916c1

See more details on using hashes here.

File details

Details for the file mplsoccer-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: mplsoccer-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 98.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.17.1 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"15.1"},"implementation":{"name":"CPython","version":"3.12.13"},"installer":{"name":"hatch","version":"1.17.1"},"openssl_version":"OpenSSL 3.5.7 9 Jun 2026","python":"3.12.13","system":{"name":"Darwin","release":"24.1.0"}} HTTPX2/2.7.0

File hashes

Hashes for mplsoccer-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62061d5de2f26f0fc489a74848f98b0cb22f3031403b4d6cb560e46303dc9400
MD5 dcc6062cf3e188082c081f5b116471ff
BLAKE2b-256 b3200284430c6eb3639b1cc1c96b3463f391752e49f11aa45f9ba1554991210e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page