Skip to main content

A library for generating Matplotlib markers from SVG files.

Project description

PyPI - Version PyPI - Status PyPI - License PyPI - Python Version PyPI - Format PyPI - Downloads Coverage >=90% test lint

SVG-pltmarker

Convert SVG graphics into Matplotlib marker paths.

Install

pip install svg-pltmarker

For development:

uv sync --dev

Usage

import matplotlib.pyplot as plt
import numpy as np
from svg_pltmarker import get_marker_from_svg

marker = get_marker_from_svg(
    url="https://upload.wikimedia.org/wikipedia/commons/8/84/Matplotlib_icon.svg"
)

fig, ax = plt.subplots(figsize=(6, 6))
ax.set_aspect("equal")
ax.set_axis_off()
x, y = np.meshgrid(np.linspace(0, 2, 11), np.linspace(0, 2, 11))
plt.scatter(x, y, marker=marker, s=2500, color="None", edgecolors="black")
plt.show()

Project links

Dependencies

  • Python >= 3.10
  • matplotlib >= 3.6.0
  • numpy >= 1.22.0
  • pydantic >= 2.0.0

Development

# Format code
uv run ruff format .

# Lint
uv run ruff check .

# Type check
uv run ty check

# Tests
uv run pytest

Equivalent targets are also available in Makefile (make format, make lint, make typecheck, make test).

See CONTRIBUTING.md for contribution workflow details.

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

svg_pltmarker-1.1.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

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

svg_pltmarker-1.1.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file svg_pltmarker-1.1.0.tar.gz.

File metadata

  • Download URL: svg_pltmarker-1.1.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for svg_pltmarker-1.1.0.tar.gz
Algorithm Hash digest
SHA256 3373006b8a89b6ed30b2e25f825ef459cb730e93516a4a785d780be2a0171826
MD5 a37f280f1781d01e13abf81893e74504
BLAKE2b-256 10b577a7e39b8d052ed86b2465f46bd0836db3d63aa1499e6ce04cfc03da1201

See more details on using hashes here.

File details

Details for the file svg_pltmarker-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: svg_pltmarker-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for svg_pltmarker-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b794002492468510cb95a0d0f3e8a66fa1ed02ccbdd2e3d6e71a59e36b2e335d
MD5 1c1eafbe86ef03a8c1ce6eda0f57c727
BLAKE2b-256 95624e248ac78fc60023c7ee34ba22ac85a51ab55c6d8230e2ff8d60dee11e8d

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