JournalPlots
A Python package for creating publication-ready matplotlib figures with consistent styling. Designed to make your scientific visualizations look professional and meet journal requirements.
Features
- 🎨 Colorblind-friendly color palettes
- 📏 Journal-appropriate font sizes and styles
- 🖼️ High-resolution output settings (300 DPI)
- 🎯 Easy-to-use styling functions
- 📐 Consistent figure dimensions
Installation
You can install the package directly from source:
git clone https://github.com/joemans3/journalplots.git
cd journalplots
pip install .
or use PyPI package:
pip install JournalPlots
Usage
Basic Usage
import matplotlib.pyplot as plt
from journalplots import set_style, apply_style, cb_colors
# Set the global style
set_style(font_scale=1.0)
# Create your plot
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [1, 2, 3], color=cb_colors()['red'], label='Data')
apply_style(ax, title='My Plot', xlabel='X', ylabel='Y')
plt.show()
Available Colors
The package includes a colorblind-friendly palette:
from journalplots import cb_colors
red = cb_colors()['red']
# Available colors:
# - COLORBLIND_COLORS = {
# - "blue": "#377eb8",
# - "orange": "#ff7f00",
# - "green": "#4daf4a",
# - "pink": "#f781bf",
# - "brown": "#a65628",
# - "purple": "#984ea3",
# - "gray": "#999999",
# - "red": "#e41a1c",
# - "yellow": "#dede00",
# }
# Using set_style, subsequent plots cycle through these colorblind colors rather than the Pyplot defaults.
Customizing Sizes
You can adjust various size parameters:
from journalplots import SIZES
# Available size presets:
# - SIZES['figure'] # Default figure size in inches
# - SIZES['font'] # Font sizes (tiny, small, medium, large, xlarge)
# - SIZES['linewidth'] # Default line width
# - SIZES['markersize'] # Default marker size
# - SIZES['tick_length'] # Length of axis ticks
Style Functions
set_style()
Sets global matplotlib parameters for consistent styling:
set_style(font_scale=1.0) # Adjust font_scale to make all text larger or smaller
apply_style()
Apply styling to a specific axes object:
apply_style(ax,
title='My Plot', # Optional plot title
xlabel='X', # Optional x-axis label
ylabel='Y', # Optional y-axis label
legend=True) # Whether to show legend
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for journalplots 0.1.21
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| journalplots-0.1.21.tar.gz | 83.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| journalplots-0.1.21-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 87.4 kB
Release files / journalplots-0.1.21.tar.gz
| Download URL | journalplots-0.1.21.tar.gz |
|---|---|
| Size | 83.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a072ee57d54b043b5e6782c65190080296e5415fb758adb6629c2d1b209a99d2
|
|
BLAKE2b-256 checksum How to use checksums |
a81e6b0e6b70139eea9545b5bbefffda4897a3092eaf7e8074e1f851b1b3f78e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 1, 2025.
Transparency logRelease files / journalplots-0.1.21-py3-none-any.whl
| Download URL | journalplots-0.1.21-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fed6b699534f97bfe9d0063f6d1fda817781ed283bbc164235ab105209d4556f
|
|
BLAKE2b-256 checksum How to use checksums |
33298ea5cfd601cd94faa4e79431eefa000d9923fe5c038401524e320e84abee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 1, 2025.
Transparency log