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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f522bd8213a3deadf8e106cfa85e225478f8c5f46f076ac9e936ae49ee00cec |
|
MD5 | 5c6b17390d5698e2beb74993c0d1bc65 |
|
BLAKE2b-256 | 0c8cd8031c0fb00809cec9f611ff4c49ccb14cf9973a7d9c89a48fdb9a336c06 |
Close
Hashes for plotly_football_pitch-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd33091145dd483b3c1d6f87c3e39f2b04f4304e004c22291822213681874f19 |
|
MD5 | 86d0f7cfd625fb02aaa0495a986353a3 |
|
BLAKE2b-256 | 27d439894cdcdff602375d5639a9038923d35a78a23d7be97daf5f3c36035ac6 |