Skip to main content

Tropical Storm and Hurricane Markers for Matplotlib

Project description

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

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? BSD 3-Clause License

Copyright (c) 2021, Alan Brammer All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

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.3.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

tcmarkers-0.0.3-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tcmarkers-0.0.3.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.12

File hashes

Hashes for tcmarkers-0.0.3.tar.gz
Algorithm Hash digest
SHA256 2e31ee5bae5462b6d23b8902af748fc419792512c5893deb7d7e25ceb16a6385
MD5 de9d28423d6186f72d6030027636c8de
BLAKE2b-256 2f5d0e7035a18beb1fbda65e4a52021fcf66d814cb275a9db6215d69b5b687a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tcmarkers-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.12

File hashes

Hashes for tcmarkers-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 04183c79df759f76614c63051143d0ccf46acb0e04b9b98f0bb88adaaca3d4ec
MD5 c448cebb58d82340c35c6922290ccefa
BLAKE2b-256 c76e04ba09ea27742c7d448d65dd521f84cf772cbf455e0eb14b5368837011bf

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