Skip to main content

Tests Passing
Documentation Status
Project Status: Active – The project has reached a stable, usable state and is being actively developed.
Python Version from PEP 621 TOML
DOI
pyOpenSci Peer-Reviewed

plot_phylo

Illustration

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.

Metadata

Release files for plot-phylo 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plot-phylo 1.0.1
File Size Uploaded
plot_phylo-1.0.1.tar.gz 17.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for plot-phylo 1.0.1
File Interpreter ABI Platform
plot_phylo-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 32.4 kB

Release files / plot_phylo-1.0.1.tar.gz

Download URL plot_phylo-1.0.1.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ab9151348703d1902c7b98911d118f393ced33ebb23e797da043eb82715bf42d
BLAKE2b-256 checksum
How to use checksums
dc111241f73ffb0adca6799cdb4c998468dd8282662cbcbb8ed597f35a17bff3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release files / plot_phylo-1.0.1-py3-none-any.whl

Download URL plot_phylo-1.0.1-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0994da5c458bf24e8ea74547f8fad9fac409b8e5e7887a8d748f703fe51f828e
BLAKE2b-256 checksum
How to use checksums
ed5714d2ca7f1412840c975582f2f7075bd86c113251f3251591651a1150cdcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

1 release file

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page