This module allows the user to plot a phylogenetic tree on an existing matplotlib axis.
Project description
plot_phylo
This module allows the user to plot a phylogenetic tree on an existing matplotlib axis.
This means that:
- Phylogenies can be incorporated into existing plots.
- Annotations can be added using standard matplotlib functionality.
- Plots can be output in png, pdf, svg or tiff formats.
- Automatically generated and updated figures can include phylogenies
Full documentation is available via ReadTheDocs.
The module depends on the ETE Toolkit, an excellent existing Python framework for analysing and visualising phylogenetic trees, plus the matplotlib visualisation library. It is designed to make generating complex figures incorporating phylogenies easier, as matplotlib plotting functions can be used on top of the basic tree.
Installation
Requirements
- python >= 3.6
- matplotlib >= 2.1.1
- ete3 >= 3.1.0
The module can be installed using pip
pip install plot_phylo
You can also download the latest release here
Or clone the GitHub repository directly.
git clone git@github.com:KatyBrown/plot_phylo.git
Quick Start
For detailed usage instructions, visit our ReadTheDocs page.
To draw a phylogeny under the default settings onto a blank figure.
import matplotlib.pyplot as plt
import plot_phylo
# Create an empty plot, 8in (width) by 10in (height) - matplotlib
f = plt.figure(figsize=(8, 10))
# Add an axis - matplotlib
ax = plt.subplot()
# Plot the tree on this axis, using the default settings - plot_phylo
results = plot_phylo.plot_phylo("examples/primates.nw", ax)
# Save the tree - matplotlib
plt.savefig("examples/basic_plot.png", bbox_inches='tight')
Cite
If you use this repository in your work, please cite:
Brown, K (2024) plot_phylo. https://github.com/KatyBrown/plot_phylo
Continuous Integration
I use GitHub Actions for continuous integration to ensure code quality. You can view the configuration here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file plot_phylo-0.1.11.tar.gz
.
File metadata
- Download URL: plot_phylo-0.1.11.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fccb9849f516af72a41e3dd91813c0c29985a29882dfe2fbe5129073ae9dbf5 |
|
MD5 | fee23e9da9722e2254dfcb13cce9e2e1 |
|
BLAKE2b-256 | f039e8764b9b9d0e76fc89b9cfc137022ecdb19be3fddf3bd6fa10ccdd25a6a8 |
File details
Details for the file plot_phylo-0.1.11-py3-none-any.whl
.
File metadata
- Download URL: plot_phylo-0.1.11-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c48411b2eadf1705321296b36762a3319da13f1a23bd9c670bd3c3cfbe375638 |
|
MD5 | 8d4f8cfe9eb91386d8f1f7e827420eb2 |
|
BLAKE2b-256 | 2107c2e7dbe4cd32c6e110f892ec04288e30dd8582d146f2e3219f45048841df |