Skip to main content
https://github.com/nvictus/svgpath2mpl/actions/workflows/python-test.yml/badge.svg

Parse SVG paths into matplotlib Path objects for plotting.

A path in SVG is defined by a ‘path’ element which contains a d="(path data)" attribute that contains moveto, line, curve (both cubic and quadratic Béziers), arc and closepath instructions. Matplotlib actually supports all of these instructions natively but doesn’t provide a parser or fully compatible API.

http://i.imgur.com/NcZVznQ.png

Based on:

  1. svg_parse for matplotlib by Nicolas P. Rougier (BSD license).

  2. svg.path by Lennart Regebro (MIT license).

This module adds the path commands missing from (1), including smooth curves and endpoint-parameterized elliptical arcs.

>>> from svgpath2mpl import parse_path
>>> parse_path('M 100 100 L 300 100')
Path(array([[ 100.,  100.], [ 300.,  100.]]), array([1, 2], dtype=uint8))

See the Jupyter Notebook gallery of examples.

Resources

See the SVG Specification.

See the matplotlib path tutorial and API docs.

License

BSD (3-Clause).

Metadata

Release files for svgpath2mpl 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for svgpath2mpl 1.0.0
File Size Uploaded
svgpath2mpl-1.0.0.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for svgpath2mpl 1.0.0
File Interpreter ABI Platform
svgpath2mpl-1.0.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 16.3 kB

Release files / svgpath2mpl-1.0.0.tar.gz

Download URL svgpath2mpl-1.0.0.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
73d0eb7cc106f05a1733cdc59ecd606423e04f9274923387d53b068e65a2f805
BLAKE2b-256 checksum
How to use checksums
c8e06589661323ebe6d15a1225fdc46123e594e958ee8b727dab1caf1ad4ddb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release files / svgpath2mpl-1.0.0-py2.py3-none-any.whl

Download URL svgpath2mpl-1.0.0-py2.py3-none-any.whl
Size 7.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e6119b7b4338dbe193919541f6d7a9df2ceb41bf1cdcb138c7d62e79efe2651d
BLAKE2b-256 checksum
How to use checksums
f73a56c66bbf535483ea028895020da87d058377a8e18355f6e0e2dc1aeb2b59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.2.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page