[Biopython] Phylo.draw - font size

Eric Talevich eric.talevich at gmail.com
Thu Mar 22 19:55:42 UTC 2012


On Thu, Mar 22, 2012 at 11:20 AM, Tanya Golubchik
<golubchi at stats.ox.ac.uk> wrote:
> Hi guys,
>
> Does anyone know how to change the font size of the text annotations on
> the current figure from Phylo.draw (ie the node names)? Changing
> rcParams['font.size'] changes the axes but not the annotations.
>

There doesn't seem to be a great way to do this directly, but you can
scale the entire image on-screen by changing the figure.dpi value. It
defaults to 80dpi, so this will magnify everything by 50%:

>>> rcParams['figure.dpi'] = 120

Alternatively, you can edit the source of Bio/Phylo/_utils.py at lines
347 (taxon labels) and 357 (confidence/support values), or copy the
entire _utils.draw function into your own code and edit the same lines
there.

If this feels ridiculous (as it probably does), I can add font_size
and branch_width_scale keyword arguments in the next release. Would
that help? Any other options you'd like to see, keeping in mind that
this function isn't meant to compete with standalone programs like
Archaeopteryx?



More information about the Biopython mailing list