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.0.tar.gz
(12.1 kB
view hashes)
Built Distribution
mplsoccer-0.0.0-py3-none-any.whl
(12.5 kB
view hashes)
Close
Hashes for mplsoccer-0.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17712cf7633577e9b6b63f98b86ffe5cc7d576aea76172279ab3df402990b93b |
|
MD5 | 92889c9a8e30fbd2505551f3210a6c25 |
|
BLAKE2b-256 | 0c3a61d2756a8e4340efd0afa307395e2845c22168dc903e431b0e272faf49d4 |