pubpy: theme_publication
=============
<p align="left">
<table>
<tr>
<td style="text-align: center;">PyPI version</td>
<td style="text-align: center;">
<a href="https://badge.fury.io/py/pubpy">
<img src="https://badge.fury.io/py/pubpy.svg" alt="PyPI version" height="18"/>
</a>
</td>
</tr>
<tr>
<td style="text-align: center;">conda-forge version</td>
<td style="text-align: center;">
<a href="https://anaconda.org/conda-forge/pubpy">
<img src="https://anaconda.org/conda-forge/pubpy/badges/version.svg" alt="conda-forge version" height="18"/>
</a>
</td>
</tr>
</table>
</p>
> **Warning**
> : The `pubpy` 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 pubpy` **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.
<p align="center">
<img src="https://github.com/haihuilab/pubpy/blob/main/examples/plots/fig01a.jpg" width="500">
</p>
You can find [the full tutorials of pubpy here](https://github.com/haihuilab/pubpy/wiki/Gallery).
Getting Started
---------------
The easiest way to install pubpy is by using `pip`:
```bash
# to install the latest release (from PyPI)
pip install pubpy
# to install the latest release (using Conda)
conda install -c conda-forge pubpy
# to install the latest commit (from GitHub)
pip install git+https://github.com/haihuilab/pubpy
# to clone and install from a local copy
git clone https://github.com/haihuilab/pubpy.git
cd pubpy
pip install -e .
```
From version `v1.0.0` on, `import pubpy` is needed on top of your scripts so Matplotlib can make use of the styles.
**Notes:**
- pubpy-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:
```python
import matplotlib.pyplot as plt
import pubpy
theme_publication('publication')
```
Examples
--------
```python
import matplotlib.pyplot as plt
import numpy as np
from pathlib import Path
from pubpy.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:
<img src="https://github.com/haihuilab/pubpy/raw/main/examples/plots/fig01a.jpg" width="500">
If you use ``pubpy`` in your paper/thesis, feel free to add it to the list!
Citing pubpy:
-------------------
@article{pubpy,
author = {Haihui Zhang et al},
title = {haihuilab/pubpy},
month = Jan,
year = 2025,
publisher = {github},
version = {1.0.0},
url = {https://github.com/haihuilab/pubpy}
}
Raw data
{
"_id": null,
"home_page": "https://github.com/haihuilab/pubpy/",
"name": "pubpy",
"maintainer": "Haihui Zhang",
"docs_url": null,
"requires_python": null,
"maintainer_email": "hanfei19@gmail.com",
"keywords": "matplotlib-style-sheets, matplotlib-figures, scientific-papers, thesis-template, matplotlib-styles, python",
"author": "Haihui Zhang",
"author_email": "hanfei19@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/57/15/8e9bebc999ce0150988625469961558f5629fb15b0622dec7bd8910a8270/pubpy-1.0.2.tar.gz",
"platform": null,
"description": "pubpy: theme_publication\n=============\n\n<p align=\"left\">\n <table>\n <tr>\n <td style=\"text-align: center;\">PyPI version</td>\n <td style=\"text-align: center;\">\n <a href=\"https://badge.fury.io/py/pubpy\">\n <img src=\"https://badge.fury.io/py/pubpy.svg\" alt=\"PyPI version\" height=\"18\"/>\n </a>\n </td>\n </tr>\n <tr>\n <td style=\"text-align: center;\">conda-forge version</td>\n <td style=\"text-align: center;\">\n <a href=\"https://anaconda.org/conda-forge/pubpy\">\n <img src=\"https://anaconda.org/conda-forge/pubpy/badges/version.svg\" alt=\"conda-forge version\" height=\"18\"/>\n </a>\n </td>\n </tr>\n </table>\n</p>\n\n> **Warning**\n> : The `pubpy` library requires LaTeX for math formatting. Install it using:\n> `sudo apt install texlive texlive-latex-extra texlive-fonts-recommended cm-super dvipng`.\n> : Starting with version 1.0.0, you must add `import pubpy` **before** setting the style with `theme_publication('publication')`.\n\n\n*Matplotlib styles for scientific figures*\n\nThis repo has Matplotlib styles to format your figures for scientific papers, presentations and theses.\n\n<p align=\"center\">\n<img src=\"https://github.com/haihuilab/pubpy/blob/main/examples/plots/fig01a.jpg\" width=\"500\">\n</p>\n\nYou can find [the full tutorials of pubpy here](https://github.com/haihuilab/pubpy/wiki/Gallery).\n\nGetting Started\n---------------\n\nThe easiest way to install pubpy is by using `pip`:\n\n```bash\n# to install the latest release (from PyPI)\npip install pubpy\n\n# to install the latest release (using Conda)\nconda install -c conda-forge pubpy\n\n# to install the latest commit (from GitHub)\npip install git+https://github.com/haihuilab/pubpy\n\n# to clone and install from a local copy\ngit clone https://github.com/haihuilab/pubpy.git\ncd pubpy\npip install -e .\n```\n\nFrom version `v1.0.0` on, `import pubpy` is needed on top of your scripts so Matplotlib can make use of the styles.\n\n**Notes:** \n- pubpy-theme_publication requires matplotlib or seaborn\n\nUsing the Styles\n----------------\n\n``\"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:\n\n```python\nimport matplotlib.pyplot as plt\nimport pubpy\n\ntheme_publication('publication')\n```\n\n\nExamples\n--------\n```python\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom pathlib import Path\nfrom pubpy.theme_publication import theme_publication\ndir = Path.cwd()\nprint('parent dir: ',dir)\n\nx = np.linspace(0, 2 * np.pi, 500)\ny = np.sin(x)\n# df = pd.DataFrame({'x': x, 'y': y})\n\ntheme_publication('publication', \n figsize='medium', \n fontsize=None, \n grid=True,\n border=True)\nplt.plot(x, y)\nplt.xlabel('x')\nplt.ylabel('y')\nplt.savefig(f'{dir}/examples/plots/fig01a.jpg')\nplt.show()\n\n```\nThe basic ``publication`` style is shown below:\n\n<img src=\"https://github.com/haihuilab/pubpy/raw/main/examples/plots/fig01a.jpg\" width=\"500\">\n\n\n\nIf you use ``pubpy`` in your paper/thesis, feel free to add it to the list!\n\nCiting pubpy:\n-------------------\n\n @article{pubpy,\n author = {Haihui Zhang et al},\n title = {haihuilab/pubpy},\n month = Jan,\n year = 2025,\n publisher = {github},\n version = {1.0.0}, \n url = {https://github.com/haihuilab/pubpy}\n }\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "Scientific theme of Matplotlib for publication",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/haihuilab/pubpy/"
},
"split_keywords": [
"matplotlib-style-sheets",
" matplotlib-figures",
" scientific-papers",
" thesis-template",
" matplotlib-styles",
" python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "48a43865a1eca13adb0676867a54dd68e564e052b463b876b38b43b033153880",
"md5": "85a22984565649a0c08e8359cac5b009",
"sha256": "fb95c12696169e9202447b1cf42df19789c21f49a2bcd1cc246fdb45ddfe7c5b"
},
"downloads": -1,
"filename": "pubpy-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "85a22984565649a0c08e8359cac5b009",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6641,
"upload_time": "2024-12-29T04:59:08",
"upload_time_iso_8601": "2024-12-29T04:59:08.612353Z",
"url": "https://files.pythonhosted.org/packages/48/a4/3865a1eca13adb0676867a54dd68e564e052b463b876b38b43b033153880/pubpy-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "57158e9bebc999ce0150988625469961558f5629fb15b0622dec7bd8910a8270",
"md5": "37e892585b5b77fa7c3264181e9013c9",
"sha256": "35b206e38da77d50d2ae6c980c07a09a72c04b1f4ff283c3ba8eb48cfc35df55"
},
"downloads": -1,
"filename": "pubpy-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "37e892585b5b77fa7c3264181e9013c9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9597,
"upload_time": "2024-12-29T04:59:11",
"upload_time_iso_8601": "2024-12-29T04:59:11.807312Z",
"url": "https://files.pythonhosted.org/packages/57/15/8e9bebc999ce0150988625469961558f5629fb15b0622dec7bd8910a8270/pubpy-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-29 04:59:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "haihuilab",
"github_project": "pubpy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pubpy"
}