[](https://badge.fury.io/gh/stonerlab%2Fstonerplots)
[](https://github.com/stonerlab/stonerplots/actions/workflows/pytest.yaml)
[](https://app.codacy.com/gh/stonerlab/stonerplots/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[](https://badge.fury.io/py/StonerPlots)
[](https://stonerlab.github.io/stonerplots/)
[](https://github.com/stonerlab/stonerplots/actions/workflows/build_conda.yaml)
[](https://anaconda.org/phygbu/stonerplots)


[](https://zenodo.org/doi/10.5281/zenodo.10905673)
# Stoner Plots
Stoner Plots is a fork of Science Plots with additional features to make plotting of scientific plots easier.
<img src="https://raw.githubusercontent.com/stonerlab/stonerplots/main/examples/figures/fig05a.png" width=640 alt="Presentation Style Image"/>
## Usage
Before using the new styles you need to import stonerplots - but you will most likely also want to make use of
one of the context managers - the `SavedFigure` class.
from stonerplots import SavedFigure
with SavedFigure("my_figure.pdf", style=["stoner","aps"]):
plt.figure()
plt.plot(x,y,label="Dataset")
...
There are three main parts to this package::
1. A set of matplotlib style sheets for making lots wih styles suitable for a variety of Physics related journals
and formats such as presentations and posters as well as reports and theses.
1. A set of Python Content managers designed to help with the process of preparing production quality figures in
matplotlib.
1. Soem defintitions of colours based on the Transport for London colour palette and inserted as named colours into
the matplotlib colour tables.
The package is fully documented (see link below) and comes with a set of examples that also server as unit tests.
## Documentation
Documentation can be found on the [github pages for this repository](https://stonerlab.github.io/stonerplots/index.html).
## Available Styles
### Core Styles
- stoner - this is the base style sheet
- poster - makes everything bigger for printing on a poster
- notebook - makes things a little bigger for a Jupyter notebook - from the original scienceplots package
- presentation - a style suitable for the main graph on a powerpoint slide
- thesis - a style that tries to look like the CM Physics group LaTeX thesis template
### Journal Styles
- nature - for Nature group journals - from the original scienceplots package
- aaas-science - Science single columne style.
- ieee - for IEEE Transactions journals - from the original scienceplots package
- aps - for American Physical Society Journals (like Phys Rev Lett etc.)
- aip - for AIP journals such as Applied Physics Letters - labels in Serif Fonts
- iop - for Institute of Physics Journals.
### Modifiers
- aps1.5 - Switch to 1.5 column wide format
- aps2.0 - Switch to 2 column wide format
- aip2 - Switch to 2 column wide format for AIP journals
- stoner-dark - Switch to a dark background a lighter plotting colours.
- hi-res - Switches to 600dpi plotting (but using eps, pdf or svg is generally a better option)
- med-res - like hi-res, but switches to 300dpi plotting.
- presentation_sm - a style for making 1/2 width graphs.
- presentation_dark - tweak the weight of elements for dark presnetations.
- science-2col, science-3col - Science 2 and 3 column width figures
- thesis-sm - reduces the figure width to make the axes closer to 4/3 aspect ratio.
## Context Managers
The package is designed to work by using python context managers to aid plotting. These include:
- SavedFigure - apply style sheets and then save any resulting figures to disc in one or more formats
- StackVertical - make a multi-panel plot where the panels are arranged in a vertical stack and pushed together so that
the top-x-axis on one frame is the bottom of the next.
- MultiPanel - a general; purpose miulti-panel plotting helper.
- InsetPlot - create an inset set of axes.
- DoubleYAxis - setup the righthand y axis for a second scale and optional colour the y-axes differently and merge
the legend into a single legend.
## Colour Cycles
The default colour cycle is based on the London Underground map colour scheme (why not?) and goes
- Northern
- Central
- Picadily
- District
- Metropolitan
- Bakerloo
- Jubilee
- Overground
- Victoria
- Elizabeth
- Circle
## Reference
The package adds these as named colours in matplotlib, along with 90,50,70 and 10% shade variants of some of them. See
the [documentation page on colours](https://stonerlab.github.io/stonerplots/colours.html) for a full list.
This package draws heavily on [scienceplots](https://github.com/garrettj403/SciencePlots), so it
seems only fair to cite the original work....
@software{john_garrett_2023_10206719,
author = {John Garrett and
Echedey Luis and
H.-H. Peng and
Tim Cera and
gobinathj and
Josh Borrow and
Mehmet Keçeci and
Splines and
Suraj Iyer and
Yuming Liu and
cjw and
Mikhail Gasanov},
title = {garrettj403/SciencePlots: 2.1.1},
month = nov,
year = 2023,
publisher = {Zenodo},
version = {2.1.1},
doi = {10.5281/zenodo.10206719},
url = {https://doi.org/10.5281/zenodo.10206719},
}
The doi and BibTex reference for stonerplots is: https://doi.org/10.5281/zenodo.14026874
@software{gavin_burnell_2024_14026874,
author = {Gavin Burnell},
title = {stonerlab/stonerplots},
month = nov,
year = 2024,
publisher = {Zenodo},
version = {v1.5.2},
doi = {10.5281/zenodo.14026874},
url = {https://doi.org/10.5281/zenodo.14026874},
}
Raw data
{
"_id": null,
"home_page": null,
"name": "StonerPlots",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "matplotlib-style-sheets, matplotlib-figures, scientific-papers, thesis-template, matplotlib-styles, python",
"author": null,
"author_email": "Gavin Burnell <G.Burnell@leeds.ac.uk>",
"download_url": "https://files.pythonhosted.org/packages/26/03/24789a03f6a01191fe48a003fcedae568431da5e449ae15900e9e00bf94c/stonerplots-1.6.1.tar.gz",
"platform": null,
"description": "\ufeff[](https://badge.fury.io/gh/stonerlab%2Fstonerplots)\n[](https://github.com/stonerlab/stonerplots/actions/workflows/pytest.yaml)\n[](https://app.codacy.com/gh/stonerlab/stonerplots/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)\n[](https://badge.fury.io/py/StonerPlots)\n[](https://stonerlab.github.io/stonerplots/)\n[](https://github.com/stonerlab/stonerplots/actions/workflows/build_conda.yaml)\n[](https://anaconda.org/phygbu/stonerplots)\n\n\n[](https://zenodo.org/doi/10.5281/zenodo.10905673)\n\n# Stoner Plots\n\nStoner Plots is a fork of Science Plots with additional features to make plotting of scientific plots easier.\n\n<img src=\"https://raw.githubusercontent.com/stonerlab/stonerplots/main/examples/figures/fig05a.png\" width=640 alt=\"Presentation Style Image\"/>\n\n## Usage\n\nBefore using the new styles you need to import stonerplots - but you will most likely also want to make use of\none of the context managers - the `SavedFigure` class.\n\n from stonerplots import SavedFigure\n\n with SavedFigure(\"my_figure.pdf\", style=[\"stoner\",\"aps\"]):\n plt.figure()\n plt.plot(x,y,label=\"Dataset\")\n ...\n\nThere are three main parts to this package::\n\n1. A set of matplotlib style sheets for making lots wih styles suitable for a variety of Physics related journals\n and formats such as presentations and posters as well as reports and theses.\n\n1. A set of Python Content managers designed to help with the process of preparing production quality figures in\n matplotlib.\n\n1. Soem defintitions of colours based on the Transport for London colour palette and inserted as named colours into\n the matplotlib colour tables.\n\nThe package is fully documented (see link below) and comes with a set of examples that also server as unit tests.\n\n## Documentation\n\nDocumentation can be found on the [github pages for this repository](https://stonerlab.github.io/stonerplots/index.html).\n\n## Available Styles\n\n### Core Styles\n\n- stoner - this is the base style sheet\n- poster - makes everything bigger for printing on a poster\n- notebook - makes things a little bigger for a Jupyter notebook - from the original scienceplots package\n- presentation - a style suitable for the main graph on a powerpoint slide\n- thesis - a style that tries to look like the CM Physics group LaTeX thesis template\n\n### Journal Styles\n\n- nature - for Nature group journals - from the original scienceplots package\n- aaas-science - Science single columne style.\n- ieee - for IEEE Transactions journals - from the original scienceplots package\n- aps - for American Physical Society Journals (like Phys Rev Lett etc.)\n- aip - for AIP journals such as Applied Physics Letters - labels in Serif Fonts\n- iop - for Institute of Physics Journals.\n\n### Modifiers\n\n- aps1.5 - Switch to 1.5 column wide format\n- aps2.0 - Switch to 2 column wide format\n- aip2 - Switch to 2 column wide format for AIP journals\n- stoner-dark - Switch to a dark background a lighter plotting colours.\n- hi-res - Switches to 600dpi plotting (but using eps, pdf or svg is generally a better option)\n- med-res - like hi-res, but switches to 300dpi plotting.\n- presentation_sm - a style for making 1/2 width graphs.\n- presentation_dark - tweak the weight of elements for dark presnetations.\n- science-2col, science-3col - Science 2 and 3 column width figures\n- thesis-sm - reduces the figure width to make the axes closer to 4/3 aspect ratio.\n\n## Context Managers\n\nThe package is designed to work by using python context managers to aid plotting. These include:\n\n- SavedFigure - apply style sheets and then save any resulting figures to disc in one or more formats\n- StackVertical - make a multi-panel plot where the panels are arranged in a vertical stack and pushed together so that\n the top-x-axis on one frame is the bottom of the next.\n- MultiPanel - a general; purpose miulti-panel plotting helper.\n- InsetPlot - create an inset set of axes.\n- DoubleYAxis - setup the righthand y axis for a second scale and optional colour the y-axes differently and merge\n the legend into a single legend.\n\n## Colour Cycles\n\nThe default colour cycle is based on the London Underground map colour scheme (why not?) and goes\n\n- Northern\n- Central\n- Picadily\n- District\n- Metropolitan\n- Bakerloo\n- Jubilee\n- Overground\n- Victoria\n- Elizabeth\n- Circle\n\n## Reference\n\nThe package adds these as named colours in matplotlib, along with 90,50,70 and 10% shade variants of some of them. See\nthe [documentation page on colours](https://stonerlab.github.io/stonerplots/colours.html) for a full list.\n\nThis package draws heavily on [scienceplots](https://github.com/garrettj403/SciencePlots), so it\nseems only fair to cite the original work....\n\n @software{john_garrett_2023_10206719,\n author = {John Garrett and\n Echedey Luis and\n H.-H. Peng and\n Tim Cera and\n gobinathj and\n Josh Borrow and\n Mehmet Ke\u00e7eci and\n Splines and\n Suraj Iyer and\n Yuming Liu and\n cjw and\n Mikhail Gasanov},\n title = {garrettj403/SciencePlots: 2.1.1},\n month = nov,\n year = 2023,\n publisher = {Zenodo},\n version = {2.1.1},\n doi = {10.5281/zenodo.10206719},\n url = {https://doi.org/10.5281/zenodo.10206719},\n }\n\nThe doi and BibTex reference for stonerplots is: https://doi.org/10.5281/zenodo.14026874\n\n @software{gavin_burnell_2024_14026874,\n author = {Gavin Burnell},\n title = {stonerlab/stonerplots},\n month = nov,\n year = 2024,\n publisher = {Zenodo},\n version = {v1.5.2},\n doi = {10.5281/zenodo.14026874},\n url = {https://doi.org/10.5281/zenodo.14026874},\n}\n",
"bugtrack_url": null,
"license": null,
"summary": "This is a fork of scienceplots and provides a range of matplotlib styles for plotting physics...",
"version": "1.6.1",
"project_urls": {
"Homepage": "https://github.com/stonerlab/stonerplots/",
"Issues": "https://github.com/stonerlab/stonerplots/issues"
},
"split_keywords": [
"matplotlib-style-sheets",
" matplotlib-figures",
" scientific-papers",
" thesis-template",
" matplotlib-styles",
" python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "401095e620f09e5f37025e207b64803895769c43d6b1f418f6652a6c9432683b",
"md5": "d6ac1d16b24eb7abdc8f934ae1534a5e",
"sha256": "c69c09b54939674621b6b9d5a5299ec6aeaf26aeb03b8f4c93139b258113bf5f"
},
"downloads": -1,
"filename": "StonerPlots-1.6.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d6ac1d16b24eb7abdc8f934ae1534a5e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 44512,
"upload_time": "2025-01-14T22:37:09",
"upload_time_iso_8601": "2025-01-14T22:37:09.472339Z",
"url": "https://files.pythonhosted.org/packages/40/10/95e620f09e5f37025e207b64803895769c43d6b1f418f6652a6c9432683b/StonerPlots-1.6.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "260324789a03f6a01191fe48a003fcedae568431da5e449ae15900e9e00bf94c",
"md5": "8ebf68cf9a4139bee71dea78f8416ed6",
"sha256": "9c3d811f78eebac38cc7f3628e6f63c8af09a7967fbef719ed5bb5aa11921673"
},
"downloads": -1,
"filename": "stonerplots-1.6.1.tar.gz",
"has_sig": false,
"md5_digest": "8ebf68cf9a4139bee71dea78f8416ed6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 2169796,
"upload_time": "2025-01-14T22:37:11",
"upload_time_iso_8601": "2025-01-14T22:37:11.954391Z",
"url": "https://files.pythonhosted.org/packages/26/03/24789a03f6a01191fe48a003fcedae568431da5e449ae15900e9e00bf94c/stonerplots-1.6.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-14 22:37:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "stonerlab",
"github_project": "stonerplots",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "stonerplots"
}