Skip to main content

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:

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')

alt text

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')

alt text

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


Download files

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

Files for mplsoccer, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size mplsoccer-0.0.1-py3-none-any.whl (12.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size mplsoccer-0.0.1.tar.gz (12.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page