Skip to main content

This module allows the user to plot a phylogenetic tree on an existing matplotlib axis.

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plot_phylo-1.0.1.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plot_phylo-1.0.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file plot_phylo-1.0.1.tar.gz.

File metadata

  • Download URL: plot_phylo-1.0.1.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for plot_phylo-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ab9151348703d1902c7b98911d118f393ced33ebb23e797da043eb82715bf42d
MD5 d3b9584ef2a9e7ac675ba144d32325f7
BLAKE2b-256 dc111241f73ffb0adca6799cdb4c998468dd8282662cbcbb8ed597f35a17bff3

See more details on using hashes here.

File details

Details for the file plot_phylo-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: plot_phylo-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for plot_phylo-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0994da5c458bf24e8ea74547f8fad9fac409b8e5e7887a8d748f703fe51f828e
MD5 c0ab72c8e6b980e87f4f9c1ee8fdbaa6
BLAKE2b-256 ed5714d2ca7f1412840c975582f2f7075bd86c113251f3251591651a1150cdcf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page