Help - Scale bar

From TreeGraph help
Jump to: navigation, search

The scale bar can be used to define the scale of branch lengths if they display some kind of node data in the phylogram/chronogram-view. Although it is also possible to have a scale bar in the rectangular cladogram-view it will usually not make any sense.

To show or hide the scale of a document use the scale bar button from the tool bar or select "Document formats..." from the format menu and check or uncheck the "Show scale bar"-option on the "Branches and labels"-tab.


A scale bar is a text element (like a node or a legend). The value of its text can be used to specify the name of the unit that was used for the branch lengths of the document (e.g. "mya"). (See Editing text element values for details on how to change the text of a text element.)

"Scale bar formats"-tab in the element formats dialog

Scale bar formats

All text formats can be applied to the labeling texts and all line formats to the dashes and the base line. The decimal format of the scale bar can be used to format the scale labels. Additionally there are special scale bar formats (see below) which can be specified too. All the formats can be changed using the element formats-dialog.


A scale bar is always positioned below the rest of the document. Here you can choose whether the scale bar shall be located left, right or always be as wide as the rest of the document (see examples below).


Distance to tree

Defines the space that is left between the scale bar and the rest of the document.


Defines the width of the scale bar (in millimeters, points or branch length units). The number of units that are displayed depends on the Distance per branch length units-value (which you can change in the document formats dialog.

Note that this option is only available if you have not selected "Whole tree width" as alignment.


Defines the height of the scale bar (in millimeters or points), which means the length of the long dashes. The height of label text is not included. (The short dashes are always half as long as the value specified here.)

Start labeling

You can select whether zero shall be on the left (e.g. if the branches show mutation rates) or the right (e.g. mya (million years ago)) side of the scale bar. For different cases you will also have to select an appropriate Alignment (see above) and Labeling direction (see below).

Labeling direction

Defines whether the labeling of the scale bar increases from left to right or contrariwise. You can combine this option with Alignment and Labeling direction (see above).


Small interval

The value specified here defines the interval (the number of branch length units) in which small unlabeled dashes are displayed. You can select any positive floating point value here. (You can define the lengths of a branch lengths units (e.g. in millimeters) in the Document formats-dialog.)

Since version 2.0.41 the according interval length in millimeters and points is displayed on the left of this input.

Long interval

This value has to be a positive integer and defines the interval in which labeled long dashes shall be displayed. The interval is specified as the number of short dashes. If you select 1 here, every dash will be a labeled long dash.

Since version 2.0.41 the according interval length in millimeters and points is displayed on the left of this input.


The following example shows a tree that displays divergence times as branch lengths and therefore uses a scale bar with "million years ago" as the unit. (You can download the TreeGraph 2 source file here.)


Used formats

  • Alignment: Whole tree width
  • Distance to tree:
  • Width: no value needed because of the selected alignment
  • Height:
  • Start labeling: Zero on the right
  • Labeling direction: Decreasing
  • Small interval: 10
  • Long interval: 10

(The text value which describes the unit is set to "mya".))

See also