StonerPlots


NameStonerPlots JSON
Version 1.5.2 PyPI version JSON
download
home_pageNone
SummaryThis is a fork of scienceplots and provides a range of matplotlib styles for plotting physics...
upload_time2024-11-01 20:40:33
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords matplotlib-style-sheets matplotlib-figures scientific-papers thesis-template matplotlib-styles python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![GitHub version](https://badge.fury.io/gh/stonerlab%2Fstonerplots.svg)](https://badge.fury.io/gh/stonerlab%2Fstonerplots)
[![pytest](https://github.com/stonerlab/stonerplots/actions/workflows/pytest.yaml/badge.svg)](https://github.com/stonerlab/stonerplots/actions/workflows/pytest.yaml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/bc7404ac3cbf432184a13b6c3cb88ea4)](https://app.codacy.com/gh/stonerlab/stonerplots/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![PyPI version](https://badge.fury.io/py/StonerPlots.svg)](https://badge.fury.io/py/StonerPlots)
[![Build Docs](https://github.com/stonerlab/stonerplots/actions/workflows/publish_sphinx.yaml/badge.svg)](https://stonerlab.github.io/stonerplots/)
[![Conda](https://github.com/stonerlab/stonerplots/actions/workflows/build_conda.yaml/badge.svg)](https://github.com/stonerlab/stonerplots/actions/workflows/build_conda.yaml)
[![Conda Version](https://anaconda.org/phygbu/stonerplots/badges/version.svg)](https://anaconda.org/phygbu/stonerplots)
![Not platform specific](https://anaconda.org/phygbu/stonerplots/badges/platforms.svg)
![MIT Licensed](https://anaconda.org/phygbu/stonerplots/badges/license.svg)
[![DOI](https://zenodo.org/badge/776970304.svg)](https://zenodo.org/doi/10.5281/zenodo.10905673)

# Stoner Plots

Stoner Plots is a fork of Science Plots

<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 it's ok to just import e.g. the SavedFigure context
manager:

    from stonerplots import SavedFigure

    with SavedFigure("my_figure.pdf", style=["stoner","aps"]):
        plt.figure()
        plt.plot(x,y,label="Dataset")
        ...

The SavedFigure context manager will handle the call to the matplotlib style context manager and will also save any
figures opened within the context manager. If the filename for the figure has an embedded place holder for {ix}, then
multiple figures can be saved without clobbering the filename.

There is also an InsetPlot context manager that can help you get insets placed correctly so that axes
labels don't escape over the edge of the surrounding figure.

    with SavedFigure("my_figure.pdf", style=["stoner","aps"]):
        plt.figure()
        plt.plot(x,y,label="Dataset")
        ...
        with InsetPlot(loc="lower right", width=0.25, height=0.25, padding=0.05) as inset:
            inset.plot(x, model(x, 200), linestyle="--")

See below for the full list of styles and context managers.

## Documentation

Documentation can be found on the [github pages for this repository](https://stonerlab.github.io/stonerplots/index.html).

## Available 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)
- 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.

## 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

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.

## 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.

This package draws heavily on [scienceplots](https://github.com/garrettj403/SciencePlots), so it seems only fair to cite the original work....

    @article{StonerPlots,
      author       = {John D. Garrett},
      title        = {{garrettj403/SciencePlots}},
      month        = sep,
      year         = 2021,
      publisher    = {Zenodo},
      version      = {1.0.9},
      doi          = {10.5281/zenodo.4106649},
      url          = {http://doi.org/10.5281/zenodo.4106649}
    }

            

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/93/c8/dd2619ef1dca2e804128ee12b5ca194614a3a0afa70a16986048a84e148c/stonerplots-1.5.2.tar.gz",
    "platform": null,
    "description": "\ufeff[![GitHub version](https://badge.fury.io/gh/stonerlab%2Fstonerplots.svg)](https://badge.fury.io/gh/stonerlab%2Fstonerplots)\n[![pytest](https://github.com/stonerlab/stonerplots/actions/workflows/pytest.yaml/badge.svg)](https://github.com/stonerlab/stonerplots/actions/workflows/pytest.yaml)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/bc7404ac3cbf432184a13b6c3cb88ea4)](https://app.codacy.com/gh/stonerlab/stonerplots/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)\n[![PyPI version](https://badge.fury.io/py/StonerPlots.svg)](https://badge.fury.io/py/StonerPlots)\n[![Build Docs](https://github.com/stonerlab/stonerplots/actions/workflows/publish_sphinx.yaml/badge.svg)](https://stonerlab.github.io/stonerplots/)\n[![Conda](https://github.com/stonerlab/stonerplots/actions/workflows/build_conda.yaml/badge.svg)](https://github.com/stonerlab/stonerplots/actions/workflows/build_conda.yaml)\n[![Conda Version](https://anaconda.org/phygbu/stonerplots/badges/version.svg)](https://anaconda.org/phygbu/stonerplots)\n![Not platform specific](https://anaconda.org/phygbu/stonerplots/badges/platforms.svg)\n![MIT Licensed](https://anaconda.org/phygbu/stonerplots/badges/license.svg)\n[![DOI](https://zenodo.org/badge/776970304.svg)](https://zenodo.org/doi/10.5281/zenodo.10905673)\n\n# Stoner Plots\n\nStoner Plots is a fork of Science Plots\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 it's ok to just import e.g. the SavedFigure context\nmanager:\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\nThe SavedFigure context manager will handle the call to the matplotlib style context manager and will also save any\nfigures opened within the context manager. If the filename for the figure has an embedded place holder for {ix}, then\nmultiple figures can be saved without clobbering the filename.\n\nThere is also an InsetPlot context manager that can help you get insets placed correctly so that axes\nlabels don't escape over the edge of the surrounding figure.\n\n    with SavedFigure(\"my_figure.pdf\", style=[\"stoner\",\"aps\"]):\n        plt.figure()\n        plt.plot(x,y,label=\"Dataset\")\n        ...\n        with InsetPlot(loc=\"lower right\", width=0.25, height=0.25, padding=0.05) as inset:\n            inset.plot(x, model(x, 200), linestyle=\"--\")\n\nSee below for the full list of styles and context managers.\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- 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- 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## 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\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\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\nThis package draws heavily on [scienceplots](https://github.com/garrettj403/SciencePlots), so it seems only fair to cite the original work....\n\n    @article{StonerPlots,\n      author       = {John D. Garrett},\n      title        = {{garrettj403/SciencePlots}},\n      month        = sep,\n      year         = 2021,\n      publisher    = {Zenodo},\n      version      = {1.0.9},\n      doi          = {10.5281/zenodo.4106649},\n      url          = {http://doi.org/10.5281/zenodo.4106649}\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.5.2",
    "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": "b5e9cb45557895f3f5d30be730a4dbfbfb8c4f30e85ccad9bc6596f0d4d43fc0",
                "md5": "5126daffd49c43523386ea477cc64727",
                "sha256": "ce7e04fb02ef688dc33f94caa82bcea7d91802d670b03dcd76d41f088b5871fe"
            },
            "downloads": -1,
            "filename": "StonerPlots-1.5.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5126daffd49c43523386ea477cc64727",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 33588,
            "upload_time": "2024-11-01T20:40:32",
            "upload_time_iso_8601": "2024-11-01T20:40:32.381439Z",
            "url": "https://files.pythonhosted.org/packages/b5/e9/cb45557895f3f5d30be730a4dbfbfb8c4f30e85ccad9bc6596f0d4d43fc0/StonerPlots-1.5.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "93c8dd2619ef1dca2e804128ee12b5ca194614a3a0afa70a16986048a84e148c",
                "md5": "c24c8083e02e0f787bc0e29d29e37f41",
                "sha256": "2dc3bf78524b98f13b3da8e20253f02e3f9ca2c83b06416bd207ac878ad15a7d"
            },
            "downloads": -1,
            "filename": "stonerplots-1.5.2.tar.gz",
            "has_sig": false,
            "md5_digest": "c24c8083e02e0f787bc0e29d29e37f41",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 2219631,
            "upload_time": "2024-11-01T20:40:33",
            "upload_time_iso_8601": "2024-11-01T20:40:33.787441Z",
            "url": "https://files.pythonhosted.org/packages/93/c8/dd2619ef1dca2e804128ee12b5ca194614a3a0afa70a16986048a84e148c/stonerplots-1.5.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-01 20:40:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "stonerlab",
    "github_project": "stonerplots",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "stonerplots"
}
        
Elapsed time: 2.51035s