Ploticus > Scripts >
proc tree

proc tree draws a rooted tree diagram from a file of data in the Newick format. Newick format is described here.

The example Newick data that created the tree1 example (above) is:

(((CAST/EiJ:0.08377, PWD/PhJ:0.15195):0.07349, ((BTBRT+tf/J:0.03469, 
(MOLF/EiJ:0.11686, (NOD/LtJ:0.01352, FVB/NJ:0.00729):0.11623):0.05377):0.09926, 
(WSB/EiJ:0.07204, AKR/J:0.05425):0.06139):1.20771):0.10313, (129S1SvImJ:0.00533, 
(C3H/HeJ:0.04002, BALB/cByJ:0.00089, (NZW/LacJ:0.01695, (KK/HlJ:0.03494, 
A/J:0.01334):0.03618):0.02865):0.02484):0.05949, DBA/2J:0.01695)[0.1429];
According to the spec, tokens can be delimited by whitespace and newlines, or not.


For this proc, a plotting area must be already set up with Y ranging from 0 to the number of leaf nodes (eg. if you have 12 leaf nodes then use yrange: 0 12). X should range from 0 to an upper end based on the magnitudes embedded in your newick data. Try xrange: 0 1 and go from there.

This proc doesn't use data as acquired by proc getdata.

This proc is new in version 2.40.


The newickfile attribute must be specified.

newickfile     pathname

    File containing data for one tree represented in newick format. The document cited above was used as the formal specification of the grammar. There is one exception: to print a single quote (') within a label, escape it with a backslash.

linedetails     linedetails

    Details controlling the color, width, and dash pattern of the arc lines.

textdetails     textdetails

    Details controlling the color and size of the text labels.

squaredoff     yes | no

    Default is yes which creates arcs that are squared off. Use no for arcs that aren't squared off.

rootsym     symboldetails

    Details controlling the data point symbol drawn at the root of the tree when squared-off arcs are being done. To omit the symbol say rootsym: none

mustparen     yes | no

    Default is yes, meaning that the first non-whitespace character in the newickfile must be an open parenthesis, or else an error will result. This allows easy screening of inappropriate or garbage input. Use no if you have a legitimate newickfile that doesn't start with an open parenthesis.


Ploticus 2.42 ... May 2013 Terms of use /