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()
## Example
import matplotlib.pyplot as plt
from PltStyler import PltStyler
# Create sample data
x = [1, 2, 3, 4, 5]
y = [1, 4, 9, 16, 25]
# Apply the stylesheet BEFORE creating the plot
PltStyler().set_stylesheet("bright").set_font(size=12, weight="bold").apply()
# Create a sample plot
fig, ax = plt.subplots(1,1, figsize=(8, 6))
# plot the data using the default parameters for line plots
lineplot_defaults = PltStyler().get_default_parameters("lineplot")
ax.plot(x, y, **lineplot_defaults)
# apply labels and title
ax.set_title("Sample Plot")
ax.set_xlabel("X-axis", fontsize=14, fontweight='bold')
ax.set_ylabel("Y-axis", fontsize=14, fontweight='bold')
plt.show()
Metadata
Release files for PltStyler 0.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pltstyler-0.0.11.tar.gz | 9.4 kB | Without provenance | Details for pltstyler-0.0.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pltstyler-0.0.11-py3-none-any.whl | Python 3 | none | any | Details for pltstyler-0.0.11-py3-none-any.whl |
Total release size: 21.2 kB
Release files / pltstyler-0.0.11.tar.gz
| Download URL | pltstyler-0.0.11.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
156d8e7b8a1ae8e3f44fcccb0a58cf788e90a152243f9d83ff88b63d9d3406e1
|
|
BLAKE2b-256 checksum How to use checksums |
e2886f5288c5e0d2c11703f996d21cb4172c965c037b371a5ab9942bf5bb1975
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.6 Windows/10
|
Release files / pltstyler-0.0.11-py3-none-any.whl
| Download URL | pltstyler-0.0.11-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df47ddcb42552889b89e86552032738abc0448504ba60952096900734325aa1c
|
|
BLAKE2b-256 checksum How to use checksums |
6caada0bcc3b3f2dfa6e9a06dda70377816bfda9392a31ba84872bfab385737d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.14.6 Windows/10
|
Security for PltStyler 0.0.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.