4

I'm currently preparing a seminar for some students. One student asked me the question whether it's possible to draw phylogenetic trees with LaTeX or not. Some research brought the newicktree-package to my eye.

The following MWE is available on the website of the developer and is used to check, if everything is working.

Is there any way to customize single nodes to be in different colors? And is there a way to print the number for the branches with a comma as a decimal marker?

\documentclass{article}

\usepackage{newicktree}

\begin{document}

\begin{newicktree}
\drawtree{((\bf My:1,first:1.5):0.5,(\sf newicktree:2,tree!:2.5):0.5):0.5;}
\end{newicktree}

\end{document}
3

for a different color use:

\begin{newicktree}
\nodelabelformat {\color{red}}%% for all
\drawtree{((\bf\color{blue} My:1,first:1.5):0.5,(\sf newicktree:2,tree!:2.5):0.5):0.5;}%% for a single
\end{newicktree}

To get a comma instead of the dot you have to redefine the macro. Not easy, but possible.

  • Now the text is in different color, that's one approach, yes. Is it possible to mark a single dot, a node, in color? Like this one here. – Ruehrfisch Dec 18 '15 at 10:30
  • P.S.: Forgot to mention, that I edited the color of the node with GIMP. – Ruehrfisch Dec 18 '15 at 10:47
  • Yes, but needs also a redefinition of existing macros, as far as I know. – user2478 Dec 18 '15 at 10:55
  • 1
    I'll have a look into the code tomorrow – user2478 Dec 18 '15 at 13:55
  • That's really generous. Thanks a lot :) – Ruehrfisch Dec 18 '15 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.