Skip to main content

Make beautiful plots of player tracking data

Project description

ptplot

ptplot makes it easy to turn player-tracking data into beautiful, interactive visualizations — including animations! These visualizations can be used to guide data exploration/analysis work, or to embed in webpages to share with the world.

example animation

Installation

ptplot can be installed via pip:

$ pip install ptplot

It is strongly recommended that you install ptplot into a virtual environment, such as with conda:

[After installing conda]
$ conda create -n player_tracking python=3
$ conda activate player_tracking
$ pip install ptplot

You may wish to install some of ptplot's dependencies via conda, specifically pandas and bokeh:

[After installing conda]
$ conda create -n player_tracking python=3 pandas bokeh
$ conda activate player_tracking
$ pip install ptplot

Getting Started

Making your first plot can be as simple as

import pandas as pd

from bokeh.plotting import show

from ptplot import PTPlot
from ptplot.nfl import Field
from ptplot.plot import Positions

data = pd.read_csv("YOUR PLAYER TRACKING DATA")
plot = PTPlot(data) + Field() + Positions("X_COORDINATE_COLUMN", "Y_COORDINATE_COLUMN")
show(plot.draw())

For additional documentation and examples, check out the notebooks in the notebooks/ directory, which can be viewed online with all of the plots correctly rendered via nbviewer:

  1. Basic Plots
  2. Animations
  3. Faceting
  4. Tips and Tricks

Additionally, layers within ptplot have docstrings with more usage details. Those can be accessed either by reading the source code or running help([FUNCTION]) inside of Python.

Development Docs

See here

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

ptplot-0.2.0.tar.gz (44.6 kB view details)

Uploaded Source

Built Distribution

ptplot-0.2.0-py2.py3-none-any.whl (27.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ptplot-0.2.0.tar.gz.

File metadata

  • Download URL: ptplot-0.2.0.tar.gz
  • Upload date:
  • Size: 44.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.11

File hashes

Hashes for ptplot-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e4c009251fbafafee7e13aff32f8a73091829e789ebc460c3121c9f337c878a4
MD5 2c74bba5c035a7bd4d7992d0d7d6c5ad
BLAKE2b-256 f2b912ec34b5095951b4193dc32c776f3cf474fa46f869cb365ce69095f6a148

See more details on using hashes here.

File details

Details for the file ptplot-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: ptplot-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 27.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.11

File hashes

Hashes for ptplot-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 da6e007c0048635ab0b0c12b61b4586ff788c2d5142f4aebea6f21a60a73b663
MD5 33b28479dc07dec05bc308ee8cce6e17
BLAKE2b-256 b7cc2f65f3a9c80d3987bd1806d2028f2573c247d5aee4e36bf1edd654c0a57d

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