Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewcharlesjones/plottify
A simple matplotlib wrapper that automatically scales font sizes, scatter point sizes, and line widths to be proportional to figure size.
https://github.com/andrewcharlesjones/plottify
Last synced: 3 months ago
JSON representation
A simple matplotlib wrapper that automatically scales font sizes, scatter point sizes, and line widths to be proportional to figure size.
- Host: GitHub
- URL: https://github.com/andrewcharlesjones/plottify
- Owner: andrewcharlesjones
- License: mit
- Created: 2021-12-25T14:40:17.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-31T11:09:42.000Z (almost 3 years ago)
- Last Synced: 2024-07-11T23:46:51.090Z (4 months ago)
- Language: Python
- Homepage:
- Size: 1.73 MB
- Stars: 108
- Watchers: 1
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# plottify
[![PyPI](https://img.shields.io/pypi/v/plottify.svg?logo=pypi&logoColor=white&label=PyPI)](https://pypi.org/project/plottify/)
The plottify package is makes matplotlib plots more legible. It's a thin wrapper around [matplotlib](https://matplotlib.org/) that automatically adjusts font sizes, scatter point sizes, line widths, etc. according to the figure size.
## Installation
```
pip install plottify
```## Usage
The plottify interface is extremely simple and relies on one central function, `autosize()`. After you've created a plot, simply call `autosize()` and the sizes will be adjusted:
```python
from plottify import autosize
import matplotlib.pyplot as pltplt.scatter(x, y)
autosize()
plt.show()
```If you have a matplotlib figure object, you can pass it as an argument to `autosize`:
```python
autosize(fig)
```## Demonstration
By default, matplotlib sets the sizes of these objects to pre-specified values, regardless of the figure size. This can result in tiny fonts or sizes for larger figures.
Plottify's `autosize` function adjusts these sizes automatically to make them more legible. When we change the figure size, plottify automatically adjusts the objects' sizes.
![demo](examples/plots/demo.png)
## Bugs and feature requests
Please report any bugs or feature requests as a GitHub issue.