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 pytest

SVG-pltmarker

A Python library for generating matplotlib markers from SVG files.

Install

pip install svg-pltmarker
pip install 'svg-pltmarker[dev]'  # for developers

Dependencies

Python version 3.10.0 or higher is required.

Libraries:

Usage

Sample notebook (Colaboratory)

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


# Generate Maplotlib marker from SVG file.
marker = get_marker_from_svg(url="https://upload.wikimedia.org/wikipedia/commons/8/84/Matplotlib_icon.svg")

# Scatter plot
fig, ax = plt.subplots(figsize=(10, 10))
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.xlim(0, 2)
plt.ylim(0, 2)
plt.show()

Then get below figure:

Sample Figure

Reference

  1. https://developer.mozilla.org/ja/docs/Web/SVG/Element
  2. https://triple-underscore.github.io/SVG11/shapes.html
  3. https://github.com/nvictus/svgpath2mpl

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

Uploaded Source

Built Distribution

svg_pltmarker-1.0.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: svg_pltmarker-1.0.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.7

File hashes

Hashes for svg_pltmarker-1.0.0.tar.gz
Algorithm Hash digest
SHA256 11b83d049d396bae9d908bb9e967f62a7dc7ee4eb62197fc29e1ee920b4d69f2
MD5 7c711c77c2d4098f8f0f60dbd8c802a9
BLAKE2b-256 df229252439c885522a955732b781936e5ec0d1ad9957345f325d0b358679a5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for svg_pltmarker-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89aad9988637812960d2a60477b27bfea3ed53754ce90138b66163202cfe215a
MD5 407f20d960ca505a8630ae9daa966282
BLAKE2b-256 7e40716b6969e7f92d1f645673c230249de040d5e4498ebaed0d99a82802a206

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