# Matplotlib AutoLayout
Matplotlib AutoLayout enables developers to easily create complex multiplots and multi-axes layouts without worrying about the exact positioning of the plots. The library automatically calculates the positions of the plots and axes based on the number of rows and columns specified by the user.
## Usage
1. Install the package
`pip install matplotlib-autolayout`
2. Import the packages needed
```python
# matplotlib-autolayout
from matplotlib_autolayout.autolayout import autolayout
# matplotlib
import matplotlib.pyplot as plt
```
3. Create a matplotlib figure and add subplots
```python
fig = plt.figure(figsize=(10, 5))
# font size
plt.rcParams.update({'font.size': 30})
# add 10 subplots
for i in range(10):
fig.add_subplot(title=f"Subplot {str(i)}").plot([1, 2, 3], [1, 2, 3])
```
4. Define a configuration
```python
configuration = {
'direction': 'column',
'margin': 0.3,
'count': 4
}
```
5. Feed into autolayout and show the plot
```python
autolayout(fig, configuration=configuration)
fig.show()
```
6. Multiplot produced

Raw data
{
"_id": null,
"home_page": "https://github.com/ericspring08/matplotlib-autolayout",
"name": "matplotlib-autolayout",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Eric Zhang",
"author_email": "ericspring08@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/37/e6/dc62a52dcacc2a048a836e702c5a3c4d59983d133108f0727546f3431766/matplotlib_autolayout-0.0.4.tar.gz",
"platform": null,
"description": "# Matplotlib AutoLayout\nMatplotlib AutoLayout enables developers to easily create complex multiplots and multi-axes layouts without worrying about the exact positioning of the plots. The library automatically calculates the positions of the plots and axes based on the number of rows and columns specified by the user.\n\n## Usage\n1. Install the package\n`pip install matplotlib-autolayout`\n2. Import the packages needed\n```python\n# matplotlib-autolayout\nfrom matplotlib_autolayout.autolayout import autolayout\n# matplotlib\nimport matplotlib.pyplot as plt\n```\n3. Create a matplotlib figure and add subplots\n```python\nfig = plt.figure(figsize=(10, 5))\n# font size\nplt.rcParams.update({'font.size': 30})\n# add 10 subplots\nfor i in range(10):\n fig.add_subplot(title=f\"Subplot {str(i)}\").plot([1, 2, 3], [1, 2, 3])\n```\n4. Define a configuration\n```python\nconfiguration = {\n 'direction': 'column',\n 'margin': 0.3,\n 'count': 4\n}\n```\n5. Feed into autolayout and show the plot\n```python\nautolayout(fig, configuration=configuration)\nfig.show()\n```\n6. Multiplot produced\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Auto layouts for matplotlib multiplots",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/ericspring08/matplotlib-autolayout"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "37e6dc62a52dcacc2a048a836e702c5a3c4d59983d133108f0727546f3431766",
"md5": "cb12a3f44bb8d823ffd967c774830117",
"sha256": "ee3f504119a8c183eed5681c6ded2a3f7cb55837cd24c49a7dd7ae343a093933"
},
"downloads": -1,
"filename": "matplotlib_autolayout-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "cb12a3f44bb8d823ffd967c774830117",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 2420,
"upload_time": "2024-08-11T05:07:55",
"upload_time_iso_8601": "2024-08-11T05:07:55.390591Z",
"url": "https://files.pythonhosted.org/packages/37/e6/dc62a52dcacc2a048a836e702c5a3c4d59983d133108f0727546f3431766/matplotlib_autolayout-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-11 05:07:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ericspring08",
"github_project": "matplotlib-autolayout",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "matplotlib-autolayout"
}