Gram, A Python Package for drawing phylogenetic trees, using LaTeX

The Gram package is a Python package that can draw phylogenetic trees. It can draw trees in the usual style, with parallel branches, with the root on the left and the leaves going right. It can also draw 'radial' trees (what some people call 'unrooted'). The output is vector graphics in a PDF file, meant to be embedded in an enclosing document. It is not meant for quick on-screen visualization, as there are plenty of good tools for that already. It is most capable when used with pdfLaTeX, but it will also use ReportLab, independent of LaTeX. Many tree diagrams made by Gram have been published in scientific journals.

Gram also makes simple line, scatter, and bar plots, with LaTeX typesetting.

The tree drawings and plots are made via Python scripts, with no GUI. (There is a tiny bit of GUI possible, but that is a bit of a clunky afterthought, and is not really the way Gram is used.)

It has a few dependencies. They include p4, PyX, pdfLaTeX, pgf and TikZ, and a few other odds and ends that you might already have.

It comes with a lot of examples. Many of the examples are put together in the documentation that is enclosed with the package; everything you need to re-make those examples and the documentation is included. The documentation is a PDF file meant to be viewed on-screen.

Download it

This is the first public posting. The version here is 2.2, from 19 July, 2012. Get the source code here. New versions may appear here from time to time.