Skip to main content

Tropical Storm and Hurricane Markers for Matplotlib

Project description

Available on pypi PyPI - Downloads Tests

TC Markers

This is a tiny repo that solely houses Matplotib paths for Tropical Storm and Hurricane symbols, neccesarily duplicated for NH and SH direction.

What do the markers look like:

Great question, that's the most important thing right. Here's the current view of them:

See repo for SVG of markers

Installation:

pip install tcmarkers

Usage:

Version 0.0.3 includes a TD and EX symbol which will be the correct size for TS and HU comparison.

import matplotlib.pyplot as plt
import tcmarkers


fig = plt.figure()
ax = fig.add_subplot(111)
marker_kwargs = {'markersize': 25, 'color':'r', 'markeredgecolor':'r'}
ax.plot(0.35, 0.25, marker=tcmarkers.EX, **marker_kwargs)
ax.plot(0.35, 0.20, marker=tcmarkers.SH_EX, **marker_kwargs)
ax.plot(0.3, 0.25, marker=tcmarkers.HU, **marker_kwargs)
ax.plot(0.3, 0.20, marker=tcmarkers.SH_HU, **marker_kwargs)
ax.plot(0.25, 0.25, marker=tcmarkers.TS,**marker_kwargs)
ax.plot(0.25, 0.20, marker=tcmarkers.SH_TS, **marker_kwargs)
ax.plot(0.20, 0.25, marker=tcmarkers.TD, **marker_kwargs)
ax.plot(0.20, 0.20, marker=tcmarkers.SH_TD, **marker_kwargs)
fig.show()
See repo for SVG of markers

Dynamic selection of symbol based on vmax. Function based on string type coming next.

import matplotlib.pyplot as plt
import tcmarkers


fig = plt.figure()
ax = fig.add_subplot(111)

for i, vmax in enumerate([33, 34, 64,]):
    ax.plot(i, 2, marker=tcmarkers.tc_marker(vmax), color='r', markeredgecolor='r', markersize=10)
    # pass latitude and SH storms returned for lat < 0
    ax.plot(i, 1, marker=tcmarkers.tc_marker(vmax, -30), color='r', markeredgecolor='r', markersize=10)

fig.show()

4 markers are now available, TD, TS, HU and EX these are available rotated for SH or original NH as well with the NH_ or SH_ prefix. e.g. NH_TD, NH_TS, NH_HU,NH_EX, SH_TD, SH_TS, SH_HU, SH_EX.

Contributing:

Have a better TC Marker? Update the SVG using the 4 characters IDs above for each object. The current markers are not perfect but I don't know how to inkscape well. Run the backend script to regenerate the markers.py file and submit a PR.

Future:

Maybe creating a child class of the matplotlib.path.Path would be nice. This could include a nicer repr and a name attribute, allowing the user to check which marker came back from the selection function?

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

tcmarkers-0.0.5.tar.gz (32.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tcmarkers-0.0.5-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file tcmarkers-0.0.5.tar.gz.

File metadata

  • Download URL: tcmarkers-0.0.5.tar.gz
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for tcmarkers-0.0.5.tar.gz
Algorithm Hash digest
SHA256 1aa3f8ada18b415fc62d6be4b4941f4cb337ea7313ee41d57ded6a5a69245588
MD5 7e7a6ed977c65a17ab7c7ce302724f98
BLAKE2b-256 53d8ba5035c913300fd072466f85466d99e1ddf6c51e12adeb7e0fc031dacee3

See more details on using hashes here.

File details

Details for the file tcmarkers-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: tcmarkers-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for tcmarkers-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bd6bdb3a5034cd7bb3f23e9059cae6d535f9a3d7cd9d5fe285b936e87741351d
MD5 4b17b19eab6cf3ac5952bd2e860d7c63
BLAKE2b-256 76f8360a5da4e96ed7de66fc3e1f69b79c5a1c17c9db036d8247551b9236820f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page