NorthPitch is a python soccer plotting library that sits on top of Matplotlib

Overview

NorthPitch

NorthPitch is a python soccer plotting library that sits on top of Matplotlib.

Install:

pip install git+https://github.com/devinpleuler/northpitch.git

Basic Example:

from northpitch.pitch import Pitch

fig, ax = plt.subplots(figsize=(15,9))
ax.set_axis_off()

pitch = Pitch()
pitch.create_pitch(ax)

plt.ylim(pitch.ylim)
plt.xlim(pitch.xlim)

plt.show()

alt text

Surface Example:

from northpitch.pitch import draw_tracking_frame
from northpitch.pitch import overlay_surface

frame = tracking_frames[n]
surface = pitch_control_function(frame)

fig, ax = draw_tracking_frame(frame, deltas=True, title="NorthPlotter example")
contours = overlay_surface(ax, surface)

plt.colorbar(contours, ax=ax)
plt.show()

Note: Provide your own list of tracking frames, and pitch control function. Sorry.

alt text

Field Size Examples

import matplotlib.pyplot as plt
from northpitch.pitch import Pitch

fig, ax = plt.subplots()
pitch = Pitch(length=110, width=70) # FIFA Minimum
pitch.create_pitch(ax)
passes = [(30,60, 20,25), (40,20, 30,50)]
pitch.draw_lines(ax, passes)
plt.ylim(pitch.ylim)
plt.xlim(pitch.xlim)
plt.show()

alt text

import matplotlib.pyplot as plt
from northpitch.pitch import Pitch

fig, ax = plt.subplots()
pitch = Pitch(length=130, width=80) # FIFA Maximum
pitch.create_pitch(ax)
passes = [(30,60, 20,25), (40,20, 30,50)]
pitch.draw_lines(ax, passes)
plt.ylim(pitch.ylim)
plt.xlim(pitch.xlim)
plt.show()

alt text

Scale Examples

import matplotlib.pyplot as plt
from northpitch.pitch import Pitch

fig, ax = plt.subplots()
pitch = Pitch(scale=(100, 100)) # Default (Opta)
pitch.create_pitch(ax)
passes = [(50,50, 60,40)]
pitch.draw_lines(ax, passes)
plt.ylim(pitch.ylim)
plt.xlim(pitch.xlim)
plt.show()

alt text

import matplotlib.pyplot as plt
from northpitch.pitch import Pitch

fig, ax = plt.subplots()
pitch = Pitch(scale=(120, 80)) # (StatsBomb)
pitch.create_pitch(ax)
passes = [(50,50, 60,40)]
pitch.draw_lines(ax, passes)
plt.ylim(pitch.ylim)
plt.xlim(pitch.xlim)
plt.show()

alt text

You might also like...
An intuitive library to add plotting functionality to scikit-learn objects.
An intuitive library to add plotting functionality to scikit-learn objects.

Welcome to Scikit-plot Single line functions for detailed visualizations The quickest and easiest way to go from analysis... ...to this. Scikit-plot i

🎨 Python3 binding for `@AntV/G2Plot` Plotting Library .
🎨 Python3 binding for `@AntV/G2Plot` Plotting Library .

PyG2Plot 🎨 Python3 binding for @AntV/G2Plot which an interactive and responsive charting library. Based on the grammar of graphics, you can easily ma

Plotting library for IPython/Jupyter notebooks
Plotting library for IPython/Jupyter notebooks

bqplot 2-D plotting library for Project Jupyter Introduction bqplot is a 2-D visualization system for Jupyter, based on the constructs of the Grammar

An open-source plotting library for statistical data.
An open-source plotting library for statistical data.

Lets-Plot Lets-Plot is an open-source plotting library for statistical data. It is implemented using the Kotlin programming language. The design of Le

Plotting library for IPython/Jupyter notebooks
Plotting library for IPython/Jupyter notebooks

bqplot 2-D plotting library for Project Jupyter Introduction bqplot is a 2-D visualization system for Jupyter, based on the constructs of the Grammar

An open-source plotting library for statistical data.
An open-source plotting library for statistical data.

Lets-Plot Lets-Plot is an open-source plotting library for statistical data. It is implemented using the Kotlin programming language. The design of Le

A deceptively simple plotting library for Streamlit

🍅 Plost A deceptively simple plotting library for Streamlit. Because you've been writing plots wrong all this time. Getting started pip install plost

Simple plotting for Python. Python wrapper for D3xter - render charts in the browser with simple Python syntax.
Simple plotting for Python. Python wrapper for D3xter - render charts in the browser with simple Python syntax.

PyDexter Simple plotting for Python. Python wrapper for D3xter - render charts in the browser with simple Python syntax. Setup $ pip install PyDexter

Cartopy - a cartographic python library with matplotlib support
Cartopy - a cartographic python library with matplotlib support

Cartopy is a Python package designed to make drawing maps for data analysis and visualisation easy. Table of contents Overview Get in touch License an

Owner
Devin Pleuler
@TorontoFC, Analytics
Devin Pleuler
:small_red_triangle: Ternary plotting library for python with matplotlib

python-ternary This is a plotting library for use with matplotlib to make ternary plots plots in the two dimensional simplex projected onto a two dime

Marc 391 Feb 17, 2021
A Python library for plotting hockey rinks with Matplotlib.

Hockey Rink A Python library for plotting hockey rinks with Matplotlib. Installation pip install hockey_rink Current Rinks The following shows the cus

null 24 Jan 2, 2023
MPL Plotter is a Matplotlib based Python plotting library built with the goal of delivering publication-quality plots concisely.

MPL Plotter is a Matplotlib based Python plotting library built with the goal of delivering publication-quality plots concisely.

Antonio López Rivera 162 Nov 11, 2022
matplotlib: plotting with Python

Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python. Check out our home page for more inform

Matplotlib Developers 16.7k Jan 8, 2023
matplotlib: plotting with Python

Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python. Check out our home page for more inform

Matplotlib Developers 13.1k Feb 18, 2021
Movies-chart - A CLI app gets the top 250 movies of all time from imdb.com and the top 100 movies from rottentomatoes.com

movies-chart This CLI app gets the top 250 movies of all time from imdb.com and

null 3 Feb 17, 2022
🎨 Python Echarts Plotting Library

pyecharts Python ❤️ ECharts = pyecharts English README ?? 简介 Apache ECharts (incubating) 是一个由百度开源的数据可视化,凭借着良好的交互性,精巧的图表设计,得到了众多开发者的认可。而 Python 是一门富有表达

pyecharts 13.1k Jan 3, 2023
🎨 Python Echarts Plotting Library

pyecharts Python ❤️ ECharts = pyecharts English README ?? 简介 Apache ECharts (incubating) 是一个由百度开源的数据可视化,凭借着良好的交互性,精巧的图表设计,得到了众多开发者的认可。而 Python 是一门富有表达

pyecharts 10.6k Feb 18, 2021
termplotlib is a Python library for all your terminal plotting needs.

termplotlib termplotlib is a Python library for all your terminal plotting needs. It aims to work like matplotlib. Line plots For line plots, termplot

Nico Schlömer 553 Dec 30, 2022
Plotting library for IPython/Jupyter notebooks

bqplot 2-D plotting library for Project Jupyter Introduction bqplot is a 2-D visualization system for Jupyter, based on the constructs of the Grammar

null 3.4k Dec 29, 2022