Skip to main content

This is a fork of scienceplots and provides a range of matplotlib styles for plotting physics...

Project description

Stoner Plots

Stoner Plots is a fork of Science Plots

Matplotlib styles for physics figures

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="--")

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
  • presentation_sm - a style for making 1/2 width graphs.

Journal Styles

  • nature - for Nature group journals - from the original scienceplots package
  • ieee - for IEEE Transactions journals - from the original scienceplots package
  • aps - for American Physical Society Journals (like Phys Rev Lett etc.)

Modifiers

  • aps1.5 - Switch to 1.5 column format
  • aps2.0 - Switch to 2 column format

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

This package draws heavily on 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}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

StonerPlots-1.0.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

StonerPlots-1.0.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file StonerPlots-1.0.0.tar.gz.

File metadata

  • Download URL: StonerPlots-1.0.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for StonerPlots-1.0.0.tar.gz
Algorithm Hash digest
SHA256 70c7d8ea8b525486e841e7d1605d5031f09918eaf834ae757c04495b8f892d3a
MD5 356e3a085523af8d9b23a0bf0db283d0
BLAKE2b-256 fbbed2eef8d2d06e108f9619d7f2a8b3c9a1b7c487458c9fdde41116c6306212

See more details on using hashes here.

File details

Details for the file StonerPlots-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: StonerPlots-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for StonerPlots-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6077fc6fdc9c4659c314bb6239d2ff7964ec2f999ad27748870a68c637a01b14
MD5 9fc01f755783f2804fc6dabf9755f375
BLAKE2b-256 790795bed6e4c24aaeed1c3760bf7c5de4af54b7415d964064f2016132574154

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page