mplsoccer is a Python plotting library for drawing soccer / football pitches quickly in Matplotlib.
Project description
mplsoccer
mplsoccer is a Python plotting library for drawing soccer / football pitches quickly in Matplotlib.
mplsoccer currently supports several data formats:
- Opta
- Tracab (ChyronHego) tracking data
- Statsbomb
- STATS (formerly Prozone)
- Wyscout (the pitch dimensions are taken from ggsoccer: https://github.com/Torvaney/ggsoccer)
The following example draws an Opta pitch (the default) with stripes.
from mplsoccer.pitch import Pitch
pitch = Pitch(orientation='horizontal',figsize=(10,10),stripe=True)
fig, ax = pitch.draw()
fig.savefig('opta.png',pad_inches=0,bbox_inches='tight')
For fun you can also plot the same pitch in xkcd mode.
from mplsoccer.pitch import Pitch
import matplotlib.pyplot as plt
plt.xkcd()
pitch = Pitch(orientation='horizontal',figsize=(10,10),stripe=True)
fig, ax = pitch.draw()
fig.savefig('opta_xkcd.png',pad_inches=0,bbox_inches='tight')
This library is under development
The following developments are planned
- rotation of scatter plot markers
- create pass map methods
- add examples (team line-up / pass maps/ pressure maps/ subplots)
- add method for plotting Voronoi diagrams
- create documentation using Sphinx
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mplsoccer-0.0.1.tar.gz
(12.2 kB
view hashes)
Built Distribution
mplsoccer-0.0.1-py3-none-any.whl
(12.5 kB
view hashes)
Close
Hashes for mplsoccer-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f03f3550c646dbc9ce06c0086639c6462fc594e0991763a7085155147c2752d |
|
MD5 | 3a1bca788cb99c1bdfe76e86f49c9b59 |
|
BLAKE2b-256 | 4dbeab50dd269e00ef233007b22238fcbe845f63c7fe7e34d368a7395da760c0 |