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.

Source Distribution

mplsoccer-0.0.1.tar.gz (12.2 kB view hashes)

Uploaded Source

Built Distribution

mplsoccer-0.0.1-py3-none-any.whl (12.5 kB view hashes)

Uploaded Python 3

Supported by

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