Skip to main content

Scientific theme of Matplotlib for publication

Project description

scimorph: theme_publication

PyPI version PyPI version
conda-forge version conda-forge version

Warning : The scimorph library requires LaTeX for math formatting. Install it using: sudo apt install texlive texlive-latex-extra texlive-fonts-recommended cm-super dvipng. : Starting with version 1.0.0, you must add import scimorph before setting the style with theme_publication('publication').

Matplotlib styles for scientific figures

This repo has Matplotlib styles to format your figures for scientific papers, presentations and theses.

You can find the full tutorials of scimorph here.

Getting Started

The easiest way to install scimorph is by using pip:

# to install the latest release (from PyPI)
pip install scimorph

# to install the latest commit (from GitHub)
pip install git+https://github.com/haihuilab/scimorph

# to clone and install from a local copy
git clone https://github.com/haihuilab/scimorph.git
cd scimorph
pip install -e .

From version v1.0.0 on, import scimorph is needed on top of your scripts so Matplotlib can make use of the styles.

Notes:

  • scimorph-theme_publication requires matplotlib or seaborn

Using the Styles

"publication" is the primary style in this repo. Whenever you want to use it, simply add the following to the top of your python script:

import matplotlib.pyplot as plt
import scimorph

theme_publication('publication')

Examples

import matplotlib.pyplot as plt
import numpy as np
from pathlib import Path
from scimorph.theme_publication import theme_publication
dir = Path.cwd()
print('parent dir: ',dir)

x = np.linspace(0, 2 * np.pi, 500)
y = np.sin(x)
# df = pd.DataFrame({'x': x, 'y': y})

theme_publication('publication', 
                    figsize='medium', 
                    fontsize=None, 
                    grid=True,
                    border=True)
plt.plot(x, y)
plt.xlabel('x')
plt.ylabel('y')
plt.savefig(f'{dir}/examples/plots/fig01a.jpg')
plt.show()

The basic publication style is shown below:

If you use scimorph in your paper/thesis, feel free to add it to the list!

Citing scimorph:

@article{scimorph,
  author       = {Haihui Zhang et al},
  title        = {haihuilab/scimorph},
  month        = Jan,
  year         = 2025,
  publisher    = {github},
  version      = {1.0.0},      
  url          = {https://github.com/haihuilab/scimorph}
}

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

scimorph-1.0.1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scimorph-1.0.1-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file scimorph-1.0.1.tar.gz.

File metadata

  • Download URL: scimorph-1.0.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for scimorph-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e0c220b78149ac9de0bf136b6d2b8ba39d290f0f0baf87fb1a1923c432438bb4
MD5 f9549cec2bbd08a6280cdef565ba0325
BLAKE2b-256 66cabe6b1afaca068ab20b6a6a4b0d0c31e17bf2f93a6c2f29887816f33035fb

See more details on using hashes here.

File details

Details for the file scimorph-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: scimorph-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for scimorph-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8fa32b2705eb5769b0620ffdf7f86e921e9ca54d40e9ac97fdba0d255d8dc8b2
MD5 7ca6046216980dc67740f11582b15f28
BLAKE2b-256 e92955ee58f900e47eeb85feb5d8ae0598d6d867d9d9fef208e5833a63e4274f

See more details on using hashes here.

Supported by

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