evolview进化树美化(2.条形图)

Please email us (Evolgenius Team) if you have any questions; attach your datasets and trees if necessary.

Bars

Index

Overview

Bar charts will be displayed next to leaf labels. For example:

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-PmqQwNfe-1596367888443)(images/DatasetBars_bars_ev.barcharts.001.png)]

Multiple bar-chart datasets can be uploaded to a tree and shown next to each other; uploaded datasets can be managed using the control panel:

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ccxC8KIq-1596367888446)(images/DatasetBars_bars_ev.barcharts.002.png)]

Supported modifiers

The following ‘modifiers’ (Key-Value pairs) are supported for bar charts:

Key (case insensitive)ValueDescription
universal modifiers
!Groups or !LegendTextcomma separated textLegend texts; for example ‘group_a,group_b,group_c’
!LegendStyle or !Stylerect or circle or starshapes to be plotted before the legend texts; default = rect
!LegendColors or !Colorscomma separated color codes or namescolors to be applied to the shapes specified by LegendStyle; for example ‘red,green,yellow’ ; note the number of colors should match the number of legend fields
!Title or !Legendtexttitle of the legend; default = name of the dataset
!ShowLegends0 or 10 : hide legends; 1 : show legends
!opacityfloat number between 0 to 1opacity of the dataset
none pie chart modifiersmodifiers that apply to some charts but not to pies
!PlotWidthinteger > 0pixel width of the dataset on canvas
!itemHeightPX or !barHeightPXinteger > 0pixel height of each bar; see examples bellow
!itemHeightPCT or !barHeightPCTfloat number between 1 to 100percentage of available height taken by each bar; see examples bellow
!gridnoneshow a background grid
!gridlabel or !axisnoneshow the values corresponding to the grid lines
bar charts specific
!align or !alignIndividualColumnnonealign individual columns if the bars are stacked
!Fanplot or ! Fannoneworks only with circular tree; see examples bellow
new: !showdataValueshow data values; see here for more details
new: !RowDataReorderno, asc, descreorder the display order of stacked bars according to their corresponding values. default no; asc: in ascending order; desc: in descending order; see here for more details

notes on preparing your datasets!!

  1. please always use TAB to separate the modifiers and their values.
  2. some modifiers should not be used in combination, e.g. !itemHeightPX and !itemHeightPCT.
  3. However if both are used (accidentally), only !itemHeightPX be used.
  4. if a modifier is used (accidentally) multiple tiles, only the last one will be used.
  5. the “data” part of this dataset can only contain two columns of tab-delimited texts; the third column, if presents, will be ignored
  6. please also always use TAB to separate the columns in the data section.

Examples

The tree :

(A:0.1,(B:0.2,(C:0.3,D:0.4)100:0.05)100:0.1)90:0.43;

Example 1:

##barplots
!groups	2009,2010,2011
!colors	lightblue,yellow,green
!showLegends	1
!plotwidth	100
!style	rect
!title	an example of bar plots
A	2,3,1
B	10,20,1
C	8,9,2
D	20,3,4

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ZyTq6hwJ-1596367888447)(images/DatasetBars_barcharts_example1.png)]


Example 2 (the same as the first one, with the following additional lines):

## turn grid on
!grid

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-QwHtPu11-1596367888449)(images/DatasetBars_barcharts_example2.png)]


Example 3 (the same as the first one, with the following additional lines):

## turn grid on
## align individual columns
!grid
!align

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-tN0CBKng-1596367888449)(images/DatasetBars_barcharts_example3.png)]


Example 4:

## fan plot of the bars in circular mode
!Fanplot

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-wnWQhWBq-1596367888450)(images/DatasetBars_barcharts_example4.png)]


Example 5:

## grid and grid label
!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
!grid
!gridlabel
A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-J3DY5QOR-1596367888451)(images/DatasetBars_barcharts_example5.png)]


Example 6:

## fan plot of the bars in circular mode
## and align individual columns
!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
!fanplot
!align
A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-EIofpSWU-1596367888451)(images/DatasetBars_barcharts_example6.png)]


heights of individual bars

By default, the height of an individual bar is 10 pixel, it can be changed using two modifiers:

  • !itemHeightPX
  • !itemHeightPCT
    !itemHeightPX specifies the absolute pixel height for individual bars; its value ranges from >0 to 40. Here are some examples:

Example 1 on item/ bar height:

!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
## -- set height for individual bars --
## -- default value is 10 --
!itemHeightPX	10
A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-EajGp9VX-1596367888452)(images/DatasetBars_barcharts_example_height1.png)]


Example 2 on item/bar height:

!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
## -- now we change the height to 20 --
!itemHeightPX	20
A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-wyfgZJV3-1596367888452)(images/DatasetBars_barcharts_example_height2.png)]


Example 3 on bar height:

!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
## -- if the pixel height is larger than the available space,
## -- which is 30 pixel in this case,
## -- only available space will be taken by the bars (30 pixel)
!itemHeightPX	35
A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-JC2EWczY-1596367888453)(images/DatasetBars_barcharts_example_height3.png)]

!itemHeightPCT specifies the percentage of available space taken by a bar; its value ranges from 1 to 100.


Example 4 on bar height:

!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
## -- let's first of all take 60% of the space ... --
!itemHeightPCT	60
A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-esithMx7-1596367888453)(images/DatasetBars_barcharts_example_height4.png)]


Example 5 on bar height:

!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
## -- bar height increases / decreases with increasing / decreasing vertical scale --
## -- still taking 60% of the space ... --
!itemHeightPCT	60
A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-bIDirdCp-1596367888453)(images/DatasetBars_barcharts_example_height5.png)]


Example 6 on bar height:

## --

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-iQ6Ebum9-1596367888454)(images/DatasetBars_barcharts_example_height6.png)]

Show data values

Now users can use modifier ‘!showdataValue’ to enable the display the bar values.

First, let’s see an example:
the tree :

(A:0.1,(B:0.2,(C:0.3,D:0.4)100:0.05)100:0.1)90:0.43;

the dataset (copy & paste) :

!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
!title	Example of barplots 4
!plotwidth	200
!itemHeightPCT	80
!grid
!axis
!showLegends	0

## -- here you go the new modifier --
## -- please use 'TAB' to separate this modifier with its value --
!showdataValue	show=1,fontsize=12,fontitalic=1,textalign=end

A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

and the result:

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-mSAglsjO-1596367888454)(images/DatasetBars_bars_showdatavalue_example2.png)]----

The ‘value’ part of the modifier !showdataValue can be any combination of the following, separated by a “,”:

key-valuealternative valuedescription
show = 10show or hide data values; optional; the data values will be shown if omitted
fontsize=12any integerset font size; optional; default = 10
fontcolor=redany value color nameset text color; optional; default = black
fontitalic=10set font italic; optional; default = 0
textalign=middlestart or endset text align; optional; default = middle; see the following examples

Here are some more examples.

Example 1:

!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
!title	Example of barplots 4
!plotwidth	200
!itemHeightPCT	80
!grid
!axis
!showLegends	0

!showdataValue	show=1,fontsize=12,fontitalic=1,textalign=end,fontcolor=white
A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-xDiOhJ00-1596367888455)(images/DatasetBars_bars_showdatavalue_example.png)]


Example 2: align the values to the end of the bars:

!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
!title	Example of barplots 4
!plotwidth	200
!itemHeightPCT	80
!grid
!axis
!showLegends	0

!showdataValue	show=1,fontsize=12,fontitalic=1,textalign=end,fontcolor=white
A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-1kxMxR3k-1596367888455)(images/DatasetBars_bars_showdatavalue_example3.png)]


Example 3: align the values to the start of the bars:

!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
!title	Example of barplots 4
!plotwidth	200
!itemHeightPCT	80
!grid
!axis
!showLegends	0
!showdataValue	show=1,fontsize=12,fontitalic=1,textalign=start,fontcolor=white
A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ZL0xrgsO-1596367888456)(images/DatasetBars_bars_showdatavalue_example4.png)]

Change display order of stacked bars

Users now can use modifier ‘!RowDataReorder’ to change the display order of the stacked bars according to their corresponding values in either ascending or descending orders.

Let’s see some examples. First the tree:

(A:0.1,(B:0.2,(C:0.3,D:0.4)100:0.05)100:0.1)90:0.43;

example 1, the default barplot:

!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
!title	barplot with data shown
!fan
!itemHeightPCT	80
!plotWidth	150


### last modified: sep 28, 2014
!showData
!showDataFontSize	10
!showDataFontColor	white
!showDataTextAlign	start

A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-DP1hgRxS-1596367888456)(/whatisnew/images/barplot-default.png)]


example 2, barplot with row data re-ordered in ascending order.

!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
!title	barplot with data shown
!fan
!itemHeightPCT	80
!plotWidth	150

## -- new modifier here!!!
!RowDataReorder	asc

### last modified: sep 28, 2014
!showData
!showDataFontSize	10
!showDataFontColor	white
!showDataTextAlign	start

A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

在这里插入图片描述


example 3, barplot with row data re-ordered in descending order.

!groups	group 1,group 2,group 3
!colors	#028482,#7ABA7A,#B76EB8
!title	barplot with data shown
!fan
!itemHeightPCT	80
!plotWidth	150

## -- new modifier here!!!
!RowDataReorder	desc

### last modified: sep 28, 2014
!showData
!showDataFontSize	10
!showDataFontColor	white
!showDataTextAlign	start

A	8,13,5
B	10,20,7
C	8,9,7
D	20,5,20

在这里插入图片描述
转自:[github]

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值