Skip to main content

`matplotlib` binder with custom styles and routines for fast plotting

Project description

myplotlib

matplotlib binder with custom styles and routines for fast plotting. see previews of available styles.

installation

pip install myplotlib

usage

loading style, fonts & colormaps

import matplotlib.pyplot as plt
from myplotlib import register

register()

plt.style.use(STYLE)
# STYLE can be:
# - fancy.dark, fancy.light
# - classic.dark, classic.light
# - mono.dark, mono.light
# - guttenberg.dark, guttenberg.light
# - latex

# you may also combine the styles:
plt.style.use([STYLE1, STYLE2])

# and you can temporarily load the style:
with plt.style.context(STYLE):
    plt.plot(...)

register() loads the bundled styles, fonts, and colormaps into Matplotlib. importing myplotlib still registers them for backward compatibility, but the explicit call keeps linters from flagging an unused side-effect import.

auxiliary plotting functions

import myplotlib.plots as myplt
# type for docstring:
myplt?

# for specific function:
myplt.plot2d?

# preview custom styles with built-in functions
import myplotlib.tests as mypltest
# type for docstring:
mypltest?

the guttenberg styles mimic renaissance-era book illustrations: old-style lettering (P22 Operina Pro, with EB Garamond as fallback for missing glyphs), imperfect hand-drawn lines, and a single-ink line cycle. they pair well with myplt.hatchedCircle, which shades circles with engraving-style hatching (optionally only the crescent shadow, as on old drawings of moon phases):

with plt.style.context("guttenberg.light"):
    fig, ax = plt.subplots()
    ax.set_aspect("equal")
    myplt.hatchedCircle(ax, (0, 0), 1, angle=45, spacing=0.15)
    myplt.hatchedCircle(ax, (2.5, 0), 1, shade_from=0, shade_depth=0.8)

for more usage examples checkout the tests/ submodule.

requirements

  • python >= 3.8
  • matplotlib >= 3.5.0, numpy
  • latex (used for fancy and latex only)
  • numba>=0.57.0

To-do

  • isocontour plotting
  • add streamplot for fieldline plotting
  • print all the newly added colormaps and the default color sequence
  • add a test plot for the demo
  • add image to readme
  • dark mode
  • monotype non-Latex mode

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

myplotlib-1.8.1.tar.gz (4.1 MB view details)

Uploaded Source

Built Distribution

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

myplotlib-1.8.1-py3-none-any.whl (4.2 MB view details)

Uploaded Python 3

File details

Details for the file myplotlib-1.8.1.tar.gz.

File metadata

  • Download URL: myplotlib-1.8.1.tar.gz
  • Upload date:
  • Size: 4.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for myplotlib-1.8.1.tar.gz
Algorithm Hash digest
SHA256 aa08b52c9ae976a02c9e513e8b90f8e999e754adc20360e0932a3c3410a90d20
MD5 0ebbe128ac30533b9196deec4c2502c9
BLAKE2b-256 a37a720dfb78d9086290abdb8aa194c3fe344dd2e172989973998228428d5a6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for myplotlib-1.8.1.tar.gz:

Publisher: publish.yml on haykh/myplotlib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file myplotlib-1.8.1-py3-none-any.whl.

File metadata

  • Download URL: myplotlib-1.8.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for myplotlib-1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a7462db75149919de18fb97f7c8ee3e649cb005076292b6f37ff554f00fc504c
MD5 20e894421569da4fee4dd14bc6225ac1
BLAKE2b-256 fa979d2c2da9a4ad5345828c943d9463d084a051dbb7ce348c8b90c77c61d739

See more details on using hashes here.

Provenance

The following attestation bundles were made for myplotlib-1.8.1-py3-none-any.whl:

Publisher: publish.yml on haykh/myplotlib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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