模板: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.)
上述文件嵌入自Template:Barlabel/doc。 (編輯 | 歷史) 編者可以在本模板的沙盒 (建立 | 鏡像)和測試樣例 (編輯)頁面進行實驗。 請在/doc子頁面中添加分類。本模板的子頁面。 |