Skip to main content

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

from plotly_football_pitch import make_pitch_figure, PitchDimensions


dimensions = PitchDimensions()
fig = make_pitch_figure(dimensions)
fig.show()

basic pitch

from plotly_football_pitch import make_pitch_figure, PitchDimensions


dimensions = PitchDimensions()
fig = make_pitch_figure(dimensions, pitch_colour="#81B622")
fig.show()

green pitch

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

basic pitch with heatmp

Installation

pip install plotly_football_pitch

Development installation

make setup-env
source .venv/bin/activate
make dev-install

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

plotly_football_pitch-0.0.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

plotly_football_pitch-0.0.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file plotly_football_pitch-0.0.1.tar.gz.

File metadata

  • Download URL: plotly_football_pitch-0.0.1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for plotly_football_pitch-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2ac8daa9a696ea0e36001d4a640448bbbbdb60f257694ca02007a92becd878cd
MD5 360a7c98065e5056e23dd39b9c9734f1
BLAKE2b-256 778eb09bf4f8cac500c70edd5545ae910808068df6f7f07618b9c7b73abd6f2f

See more details on using hashes here.

File details

Details for the file plotly_football_pitch-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for plotly_football_pitch-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc63fbae1f8db8874bda42da9a6a9617922f7f386a50c3705bc699eb816f1459
MD5 01211a5c932671a58c3dcac6915521ae
BLAKE2b-256 8e369e3c212abd0ec0f4d4edf427feaf51092279f80a6b327f075712ce62cf17

See more details on using hashes here.

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