Skip to main content

PltStyler

A simple package to provide a collection of stylesheets and default values for Python matplotlib figures. The goal is to make it easy to create visually appealing and consistent plots with minimal effort.

I will add more stylesheets and default values in the future! If you have any suggestions or want to contribute, feel free to open an issue or a pull request.

Installation

You can install PltStyler using pip:

pip install PltStyler

Usage

To use PltStyler, simply import the desired stylesheet and apply it to your matplotlib figures. For example:

import matplotlib.pyplot as plt
from PltStyler import PltStyler

# Apply the default stylesheet
PltStyler().apply()

# Apply a predefined stylesheet (e.g., "dark")
PltStyler().set_stylesheet("dark").apply()

# Apply a custom stylesheet - must be json (see below for an example)
PltStyler().set_stylesheet("path/to/stylesheet.json").apply()

# Change the font
PltStyler().set_font(family="Arial", weight="normal").apply()

# Because the PltStyler is a singleton and the methods return the instance itself, you can chain the methods together for conveniently readable code:
PltStyler().set_stylesheet("dark").set_font(family="Arial", weight="normal").apply()

# The PltStyler inclused default parameters for the following plot types:
# - Line plots
# - Scatter plots
# - Box plots
# - Histograms

lineplot_defaults = PltStyler().get_lineplot_defaults()

# Create a sample plot
x = [1, 2, 3, 4, 5]
y = [1, 4, 9, 16, 25]
plt.plot(x, y, **lineplot_defaults) # apply lineplot defaults
plt.title("Sample Plot")
plt.xlabel("X-axis")
plt.ylabel("Y-axis")
plt.show()

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pltstyler-0.0.9.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

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

pltstyler-0.0.9-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file pltstyler-0.0.9.tar.gz.

File metadata

  • Download URL: pltstyler-0.0.9.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.9.9 Windows/10

File hashes

Hashes for pltstyler-0.0.9.tar.gz
Algorithm Hash digest
SHA256 0cb3bab6170833a2c33b61d5c9769c8061dcac289d777a5042a9495d5b7c513f
MD5 2fc48e3c98b43b6e191c07530c91e246
BLAKE2b-256 35a234b5882c075d5e6e94a718c971c7a5ca9dc8d7f02279430e570242062090

See more details on using hashes here.

File details

Details for the file pltstyler-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: pltstyler-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.9.9 Windows/10

File hashes

Hashes for pltstyler-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 acbb3e1b53afb1abdb7a4411604c019d7da216b29b71ee04fa469e1eaea78921
MD5 896f48a297ca6e3214d8bf0f11a0abda
BLAKE2b-256 e67025474b604f0f1469e901e8ef6ea8043eda968264c143bc006aa55f27aedd

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.11

2 files

0.0.10

2 files

This release

0.0.9 This release

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page