Skip to main content

A python plotting library for visualisation of stadium data

Project description

A Python plotting library to visualize stadium data

Quick start

Install the package using pip (or pip3).

pip install mplstadium

Plot an outdoor 400m running track, with the origin at the centre of the track:

from mplstadium.utils import OutdoorAthleticsTrack
from matplotlib import pyplot as plt

track = OutdoorAthleticsTrack()
fig, ax = track.draw(line_kwargs={"color": "black"})
plt.show()

Plot an Olympic Velodrome in 3D and a trajectory on the surface:

from utils import OlympicVelodrome
import numpy as np
from matplotlib import pyplot as plt

track = OlympicVelodrome()
fig, ax = track.draw_3d(color="peru", alpha=0.5)

s = np.linspace(0, 250, 250)
d = 4 + 4 * np.sin(s / 10)

track.trajectory(s, d, c="r")

ax.set_aspect("equal")
ax.axis("off")
plt.show()

Define a custom Stadium geometry and plot scatter points over it:

from stadium import Stadium
import numpy as np
from matplotlib import pyplot as plt

track = Stadium(
    length=500,
    radius=24.37,
    width=12,
    straight_banking=0,
    curve_banking=20,
)
fig, ax = track.draw_3d(color="black", alpha=0.5)

s = np.linspace(0, 500, 50)
d = np.random.uniform(0, 12, 50)

track.scatter(s, d, c="r")

ax.set_aspect("equal")
ax.axis("off")
plt.show()

License

MIT

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

mplstadium-0.1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

mplstadium-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file mplstadium-0.1.0.tar.gz.

File metadata

  • Download URL: mplstadium-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.11 Windows/10

File hashes

Hashes for mplstadium-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f161c9f965ac1a5384a537281b7a76c83a7beac313d9e0e5f6e892f597e0f986
MD5 8fb5f236830b498758060b607ec5d1f6
BLAKE2b-256 df5466173bf22ebba6bab190612d6653d8ec4327d99e3092e7600012605e0d35

See more details on using hashes here.

File details

Details for the file mplstadium-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mplstadium-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.11 Windows/10

File hashes

Hashes for mplstadium-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 111f344371ec9fee5ffadd374db984d5171de0616985d66fb6dda0c2bdb2eb88
MD5 1286c9f5d4f3cdff148895cbc8390ba5
BLAKE2b-256 8d4f3d15b066b5be6ded066c1c9c9cbce7be4848927f533ffccc56ceabcdee80

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