Package to allow creation of football pitch charts using plotly
Project description
plotly-football-pitch
This repo contains code to plot football pitches using plotly
. Currently only horizontal pitches are supported, with the origin located at the bottom left
corner of the pitch.
Examples
Further examples can be found in examples/pitch.ipynb
.
from plotly_football_pitch import make_pitch_figure, PitchDimensions
dimensions = PitchDimensions()
fig = make_pitch_figure(dimensions)
fig.show()
from plotly_football_pitch import (
make_pitch_figure,
PitchDimensions,
SingleColourBackground
)
dimensions = PitchDimensions()
fig = make_pitch_figure(
dimensions,
pitch_background=SingleColourBackground("#81B622"),
)
fig.show()
import numpy as np
from plotly_football_pitch import make_pitch_figure, PitchDimensions
dimensions = PitchDimensions()
fig = make_pitch_figure(dimensions)
# define number of grid squares for heatmap data
width_grid = 12
length_grid = 15
data = np.array([
[random.random() for _ in range(length_grid)]
for _ in range(width_grid)
])
fig = add_heatmap(fig, data)
fig.show()
Installation
pip install plotly_football_pitch
Development installation
make setup-env
source .venv/bin/activate
make dev-install
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
Built Distribution
Close
Hashes for plotly_football_pitch-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 454f79cb08f7da5ecb1034eb9dc8e00d37c8f0d8820a0ef27c0004c94855ad03 |
|
MD5 | 2fe4f5b9deddfebf9015514422a1d68c |
|
BLAKE2b-256 | 5d144958ee336972af2e8b9dd93650980c58b3e8030071da0ab588472d97a403 |
Close
Hashes for plotly_football_pitch-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b1d85a93d244daeeee1e6fe865777086c7a0b98da6e5dd3819ff46a1c5dd9e6 |
|
MD5 | 74255125c34746a6b7f8ec012ed0ca04 |
|
BLAKE2b-256 | 10f8786d05698f578ec890e0fbf082b43ae8020b649e237975165f1e1abbe803 |