This template is used to add labels to brackets and bars which have been added to cladograms constructed with ((clade)).

Usage

  1. First create a cladogram using ((clade)).
  2. Then embed the cladogram in this template as the value of |cladogram=.

Example

Suppose you have created the cladogram shown below.

GM

A1

A2

A3

M

C1

C2

G1 

G2

G3

To provide labels for the two groups identified in the cladogram:

The full expression required is shown below (excluding the code to create the cladogram).

((Barlabel
|size=7
|at1=3|label1=Group 1|bar1=green
|at2=5.5|label2=Group 2|bar2=purple
|cladogram=...
))

This produces

GM

A1

A2

A3

M

C1

C2

G1 

G2

G3

Group 1
Group 2

To reduce the font size of the cladogram and its labels, use the style parameter. Thus

((Barlabel
|style=font-size:85%
|size=7
|at1=3|label1=Group 1|bar1=green
|at2=5.5|label2=Group 2|bar2=purple
|cladogram=...
))

produces

GM

A1

A2

A3

M

C1

C2

G1 

G2

G3

Group 1
Group 2

The cladogram can be aligned to the right, with text flowing around it to the left, but in this case you must specify the space allowed for the labels using the parameter labelwidth, otherwise the labels will appear off the right of the page. Trial and error may be needed, but about 60% of the number of characters in the longest label is usually a good starting point. Thus

((Barlabel
|style=font-size:85%|align=right|labelwidth=4.5
|size=7
|at1=3|label1=Group 1|bar1=green
|at2=5.5|label2=Group 2|bar2=purple
|cladogram=...
))

produces the cladogram on the right below.

GM

A1

A2

A3

M

C1

C2

G1 

G2

G3

Group 1
Group 2

The cladogram can be placed centrally on the page by specifying |align=center or |align=centre. The labelwidth parameter is needed to ensure the cladogram is centred; if it is omitted, the labels will be ignored in determining the placement. Thus

((Barlabel
|style=font-size:85%|align=center|labelwidth=4.5
|size=7
|at1=3|label1=Group 1|bar1=green
|at2=5.5|label2=Group 2|bar2=purple
|cladogram=...
))

produces

GM

A1

A2

A3

M

C1

C2

G1 

G2

G3

Group 1
Group 2

The cladogram can also be aligned left with text flowing around it to the right by using |align=left. Again the labelwidth parameter is needed, otherwise the labels will overlap the text.

(The template can be used to align cladograms without brackets/bars and labels, although ((cladogram)) offers more options for doing this.)

Parameters

Up to six labels can be provided. They are identified by the digit in the name of the parameter. Each label requires three parameters, e.g. at2, label2 and bar2 for the second label. There is no connection between these numbers and the numbers used to identify child nodes in ((clade)). The "1" can be omitted, i.e. at, label and bar are equivalent to at1, label1 and bar1.

Limitations, debugging

The template works by constructing a hidden table. Different browsers (user agents) have different algorithms for laying out tables, so the precise alignment of the labels differs between browsers and platforms, and is not always exactly opposite the chosen leaf node. Although it's possible to 'tweak' the alignment for one browser/platform combination (e.g. by using fractional positions other than 0.5), this won't work across combinations.

The template does not check the ranges of the parameters supplied, so make sure that the values of the atN parameters are less or equal to the value of the size parameters. Label N will only be displayed if size, atN and labelN are defined. The colour of the text of the label (defined by barN, colorN or colourN) defaults to black.

Setting labelwidth is needed whenever the cladogram is aligned to the centre, right or left. This includes placing ((barlabel)) inside ((cladogram)) and aligning it to the right via that template.