Template:Barlabel
No cladogram specified! |
This template is used to add labels to brackets and bars which have been added to cladograms using {{cladex}}.
用法
[编辑]示例
[编辑]假设你已经建立了如下的树:
GM |
| |||||||||||||||||||||||||||
可以通过以下方法,给图中所示的两个组添加标签:
- Count the number of leaf nodes in the cladogram; here there are 7. The parameter
size
will be set to 7. - Decide against which leaf nodes you want the labels to go. To centre the labels, the label for the green group should be opposite leaf node 3; the label for the purple group should be between leaf nodes 5 and 6, i.e. opposite leaf node "5.5". The
at
parameters of the template are set to these values.
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
|
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
|
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.
|
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
|
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.)