Main Content

plot

Draw phylogenetic tree

Syntax

plot(Tree)
plot(Tree, ActiveBranches)
H = plot(...)
plot(..., 'Type', TypeValue, ...)
plot(..., 'Orientation', OrientationValue, ...)
plot(..., 'Rotation', RotationValue, ...)
plot(..., 'BranchLabels', BranchLabelsValue, ...)
plot(..., 'LeafLabels', LeafLabelsValue, ...)
plot(..., 'TerminalLabels', TerminalLabelsValue, ...)
plot(..., 'LLRotation', LLRotationValue, ...)

Input Arguments

TreePhylogenetic tree object created, such as created with the phytree constructor function.
ActiveBranches

Logical array of size numBranches-by-1 indicating the active branches, which are displayed in the Figure window.

TypeValue

Character vector or string specifying a method for drawing the phylogenetic tree. Choices are:

  • 'square' (default)

  • 'angular'

  • 'radial'

  • 'equalangle'

  • 'equaldaylight'

OrientationValue

Character vector or string specifying the position of the root node, and hence the orientation of a phylogram or cladogram tree, when the 'Type' property is 'square' or 'angular'. Choices are:

  • 'left' (default)

  • 'right'

  • 'top'

  • 'bottom'

RotationValue

Scalar between 0 (default) and 360 specifying rotation angle (in degrees) of the phylogenetic tree in the Figure window, when the 'Type' property is 'radial', 'equalangle', or 'equaldaylight'.

BranchLabelsValue

Controls the display of branch labels next to branch nodes. Choices are true or false (default).

LeafLabelsValue

Controls the display of leaf labels next to leaf nodes. Choices are true or false. Default is:

  • true — When the 'Type' property is 'radial', 'equalangle', or 'equaldaylight'

  • false — When the 'Type' property is 'square' or 'angular'

TerminalLabels

Controls the display of terminal labels over the axis tick labels, when the 'Type' property is 'square' or 'angular'. Choices are true (default) or false.

LLRotationValue

Controls the rotation of leaf labels so that the text aligns to the root node, when the 'Type' property is 'radial', 'equalangle', or 'equaldaylight'. Choices are true or false (default).

Output Arguments

H

Structure with handles to seven graph elements. The structure includes the following fields:

  • axes

  • BranchLines

  • BranchDots

  • LeafDots

  • branchNodeLabels

  • leafNodeLabels

  • terminalNodeLabels

Tip

Use the set function with the handles in this structure and their related properties to modify the plot. For more information on the properties you can modify using the axes handle, see Axes Properties. For more information on the properties you can modify using the BranchLines, BranchDots, or LeafDots handle, see Line Properties. For more information on the properties you can modify using the branchNodeLabels, leafNodeLabels, or terminalNodeLabels handle, see Text Properties.

Description

plot(Tree) draws a phylogenetic tree object into a figure as a phylogram. The significant distances between branches and nodes are in the horizontal direction. Vertical distances are arbitrary and have no significance.

plot(Tree, ActiveBranches) hides the nonactive branches and all of their descendants in the Figure window. ActiveBranches is a logical array of size numBranches-by-1 indicating the active branches.

H = plot(...) returns a structure with handles to seven graph elements.

plot(..., 'Type', TypeValue, ...) specifies a method for rendering the phylogenetic tree. Choices are as follows.

Rendering Type Description
'square' (default)

'angular'

'radial'

'equalangle'

Tip

This rendering type hides the significance of the root node and emphasizes clusters, thereby making it useful for visually assessing clusters and detecting outliers.

'equaldaylight'

Tip

This rendering type hides the significance of the root node and emphasizes clusters, thereby making it useful for visually assessing clusters and detecting outliers.

plot(..., 'Orientation', OrientationValue, ...) specifies the orientation of the root node, and hence the orientation of a phylogram or cladogram phylogenetic tree in the Figure window, when the 'Type' property is 'square' or 'angular'.

plot(..., 'Rotation', RotationValue, ...) specifies the rotation angle (in degrees) of the phylogenetic tree in the Figure window, when the 'Type' property is 'radial', 'equalangle', or 'equaldaylight'. Choices are any scalar between 0 (default) and 360.

plot(..., 'BranchLabels', BranchLabelsValue, ...) hides or displays branch labels next to the branch nodes. Choices are true or false (default).

plot(..., 'LeafLabels', LeafLabelsValue, ...) hides or displays leaf labels next to the leaf nodes. Choices are true or false. Default is:

  • true — When the 'Type' property is 'radial', 'equalangle', or 'equaldaylight'

  • false — When the 'Type' property is 'square' or 'angular'

plot(..., 'TerminalLabels', TerminalLabelsValue, ...) hides or displays terminal labels over the axis tick labels, when the 'Type' property is 'square' or 'angular'. Choices are true (default) or false.

plot(..., 'LLRotation', LLRotationValue, ...) controls the rotation of leaf labels so that the text aligns to the root node, when the 'Type' property is 'radial', 'equalangle', or 'equaldaylight'. Choices are true or false (default).

Examples

% Create a phytree object from a file
tr = phytreeread('pf00002.tree')
% Plot the tree and return a structure with handles to the
% graphic elements of the phytree object
h = plot(tr,'Type','radial')

% Modify the font size and color of the leaf node labels
% by using one of the handles in the return structure
set(h.leafNodeLabels,'FontSize',6,'Color',[1 0 0])

Version History

Introduced before R2006a