A library for generating Matplotlib markers from SVG files.
Project description
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:
- matplotlib >= 3.6.0
- NumPy >= 1.22.0
- pydantic >= 2.0.0
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:
Reference
Project details
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
Close
Hashes for svg_pltmarker-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89aad9988637812960d2a60477b27bfea3ed53754ce90138b66163202cfe215a |
|
MD5 | 407f20d960ca505a8630ae9daa966282 |
|
BLAKE2b-256 | 7e40716b6969e7f92d1f645673c230249de040d5e4498ebaed0d99a82802a206 |