Metadata-Version: 2.4
Name: figtreemap
Version: 0.1.0
Summary: Plot treemaps with figures and phylopics
Project-URL: Homepage, https://github.com/Quantitative-Omics-Research/figtreemap
Project-URL: Bug Tracker, https://github.com/Quantitative-Omics-Research/figtreemap/issues
Author: DAWells
License-Expression: MIT
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Requires-Dist: cairosvg
Requires-Dist: lxml
Requires-Dist: matplotlib
Requires-Dist: numpy
Requires-Dist: opentree
Requires-Dist: pillow
Requires-Dist: ratelimit
Requires-Dist: requests
Requires-Dist: squarify
Description-Content-Type: text/markdown

# figtreemap
Plot treemaps with figures. [Source code](https://github.com/Quantitative-Omics-Research/figtreemap), [Docs](https://quantitative-omics-research.github.io/figtreemap/).


Create treemaps with images proportional to the rectangles. This package focuses on getting and colouring [phylopic](https://www.phylopic.org/) SVGs but any PNG will work too.

# 🛠️ Installation
```bash
pip install figtreemap
```

# 🚀 Quick start
```{python}
import matplotlib.pyplot as plt
import figtreemap

sizes = [30,4,450,700,190,1200,2,50,70,450,60]
names = ["Canis familiaris","Felis catus","Equus ferus","Bos taurus","Panthera leo","Giraffa camelopardalis","Oryctolagus cuniculus","Pan troglodytes","Homo sapiens","Ursus maritimus","Orycteropus afer"]

svgs = [figtreemap.phylopics.get_svg(name) for name in names]
imgs = [figtreemap.image_prep.prep_svg(svg) for svg in svgs]
figtreemap.squarify_images.figtreemap(sizes, imgs)
plt.show()
```
# ✨ Features
Python package to plot treemaps with figures.

- Get phylopic SVG based on species name, if an image is not available the most specific available image for the lineage.
- Prepare images for plotting with simple SVG editing and convertion to PNG.
- Plot images in treemaps.

# 📄 Docs
Docs are hosted [here](https://quantitative-omics-research.github.io/figtreemap/)
with a [step by step guide](https://quantitative-omics-research.github.io/figtreemap/guide.html)
and [API reference](https://quantitative-omics-research.github.io/figtreemap/docs/api_index.html).

# 🐛 Troubleshooting
Please highlight bugs and ask questions as github [issues](https://github.com/Quantitative-Omics-Research/figtreemap/issues).

# 🤝 Contributing
Please make requests and suggestions as github [issues](https://github.com/Quantitative-Omics-Research/figtreemap/issues) and if you would like to make an improvement yourself please submit a pull request.

# ⚖️ Licence
`figtreemap` is distributed under [MIT licence](https://github.com/Quantitative-Omics-Research/figtreemap/blob/main/LICENCE).
