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 details)
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11b83d049d396bae9d908bb9e967f62a7dc7ee4eb62197fc29e1ee920b4d69f2 |
|
MD5 | 7c711c77c2d4098f8f0f60dbd8c802a9 |
|
BLAKE2b-256 | df229252439c885522a955732b781936e5ec0d1ad9957345f325d0b358679a5d |
File details
Details for the file svg_pltmarker-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: svg_pltmarker-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89aad9988637812960d2a60477b27bfea3ed53754ce90138b66163202cfe215a |
|
MD5 | 407f20d960ca505a8630ae9daa966282 |
|
BLAKE2b-256 | 7e40716b6969e7f92d1f645673c230249de040d5e4498ebaed0d99a82802a206 |