Thanks for your interest in contributing! This guide covers the basics — reporting bugs, proposing changes, adding journal specs, and submitting pull requests.
Before opening an issue, search existing issues to avoid duplicates.
- Bug reports — use the Bug Report template. Include a minimal reproducing example, the full traceback, and your environment details (PlotStyle version, matplotlib version, Python version, OS).
- Spec inaccuracies — use the Spec Inaccuracy template. Include a link to the journal's official guidelines and a table of what's wrong vs. what it should be.
- New journal specs — use the New Journal Spec template. Fill in as many fields as you can from the journal's author guidelines.
PlotStyle uses Hatch as its build and environment manager.
# Clone the repo
git clone https://github.com/rahulkaushal04/plotstyle.git
cd plotstyle
# Create a virtual environment and install with dev dependencies
pip install -e ".[dev]"If you also need seaborn or fonttools extras:
pip install -e ".[all,dev]"pytestPlotStyle uses Ruff for linting and formatting:
ruff check src/ tests/
ruff format --check src/ tests/To auto-fix lint issues and reformat:
ruff check --fix src/ tests/
ruff format src/ tests/If you have pre-commit installed:
pre-commit installThis will run linting and formatting checks automatically before each commit.
Journal specs live in src/plotstyle/specs/ as .toml files. Each file describes a single journal's figure requirements (dimensions, fonts, export settings, etc.).
-
Copy the template — start from
src/plotstyle/specs/_templates.toml:cp src/plotstyle/specs/_templates.toml src/plotstyle/specs/<journal>.toml
Use a short, lowercase name (e.g.
nature.toml,ieee.toml,plos.toml). -
Fill in the spec — open the journal's official author/figure guidelines and fill in every field you can. Look at an existing spec like
nature.tomlfor reference. Key sections:[metadata]— journal name, publisher, guidelines URL, date verified, your GitHub username[dimensions]— single-column width, double-column width, max height (all in mm)[typography]— required fonts, font size range, panel label style[export]— accepted formats, minimum DPI, color space, font embedding[color]— accessibility requirements (colorblind, grayscale)[line]— minimum line weight in points
-
Validate — run the validation script to check your spec against the schema:
python scripts/validate_all_specs.py
All fields listed in the template are expected. If the journal's guidelines don't specify a value, use a sensible default and note it in the PR.
-
Test — run the full test suite to make sure nothing is broken:
pytest
-
Submit a PR — include a link to the journal's official figure preparation guidelines in your PR description.
Follow the same process but edit the existing .toml file instead of copying the template. Update last_verified and verified_by in the [metadata] section.
- Fork the repository and create a branch from
main. - Make your changes. Keep commits focused — one logical change per commit.
- Add or update tests if your change affects behavior.
- Make sure these all pass before pushing:
pytestruff check src/ tests/
- Open a pull request.
Fill out the PR template when you open your PR. In particular:
- Describe what the PR does and why.
- Link to any related issues (
Closes #...). - Describe how you tested the change.
- Check off the items in the checklist:
-
pytestpasses -
ruff check src/ tests/passes - Tests added or updated (if applicable)
- Docs updated (if the public API changed)
-
If adding or updating a journal spec:
- Ran
python scripts/validate_all_specs.py - Included a link to the journal's official figure preparation guidelines
- Python 3.10+ syntax (use
X | Yunions,matchstatements where appropriate). - Ruff handles formatting (double quotes, 4-space indent, 100-char line length).
- NumPy-style docstrings for public API.
- Type annotations on all public functions.
Open a discussion or ask in your PR — happy to help.