No project description provided
Project description
mpl-flags
National flags for Matplotlib.
Flags data
mpl-flags contains the flag data in vector format readily usable with
Matplotlib. The original flags data are in svg format, and are converted to
matplotlib's Path data using mpl-simple-svg-parser. mpl-flags does not
contain the original svg files, only the converted data in numpy format
(vertices and codes).
The flag data is collected from various sources. Currently, it includes flags from
- Google's noto color emoji font : https://github.com/googlefonts/noto-emoji
- circle-flags : https://github.com/HatScripts/circle-flags
- flag-icons : https://github.com/lipis/flag-icons
Different sources can render the flags differently.
Usage
from mpl_flags import Flags
flags = Flags("noto_waved") # You initialize the Flags class specifying what kind of
# flags you like to use.
# `noto_waved` is flags from google's noto emoji fonts.
fig, ax = plt.subplots(figsize=(3, 3))
flags.show_flag(ax, "KR")
from matplotlib.offsetbox import AnnotationBbox
flags = Flags("noto_original")
fig, ax = plt.subplots(figsize=(3, 3))
da = flags.get_drawing_area("KR", wmax=100)
ab = AnnotationBbox(da, (0.5, 0.5), frameon=True,
box_alignment=(0.5, 0.5))
ax.add_artist(ab)
Installation
You can install using pip:
pip install mpl_flags
Development Installation
pip install -e ".[dev]"
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mpl_flags-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mpl_flags-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e25a2df1d2da1131a235dfefec87512e763843e65bae1923c2a568a8346cc0b1
|
|
| MD5 |
e8378ccb130205d01c5300fae833bf5b
|
|
| BLAKE2b-256 |
3cb453f60fac7a296a269543ace9be30c05504e1c3b5f9f38c484355563904ac
|