Home

figtreemap

Plot treemaps with figures. Source code, Docs.

Create treemaps with images proportional to the rectangles. This package focuses on getting and colouring phylopic SVGs but any PNG will work too.

🛠️ Installation

pip install figtreemap

🚀 Quick start

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 with a step by step guide and API reference.

🐛 Troubleshooting

Please highlight bugs and ask questions as github issues.

🤝 Contributing

Please make requests and suggestions as github issues and if you would like to make an improvement yourself please submit a pull request.

⚖️ Licence

figtreemap is distributed under MIT licence.