Giter Club home page Giter Club logo

mplsoccer's Introduction

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

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

alt text

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

alt text


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 [email protected] 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:


License

MIT

mplsoccer's People

Contributors

andrewrowlinson avatar anenglishgoat avatar devinpleuler avatar dymondformation avatar eljdp avatar sholaybhature avatar slothfulwave612 avatar willthomson1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.