小编sta*_*dav的帖子

ggplot2 - 饼图 - 以相反顺序排列的值标签

我正在尝试将标签与我的饼图与ggplot2匹配:

码:

values=c(59,4,4,11,26)
labels=c("catA", "catB","catC","catD","catE")
pos = cumsum(values)- values/2
graph <- data.frame(values, labels,pos)

categoriesName="Access"
percent_str <- paste(round(graph$values / sum(graph$values) * 100,1), "%", sep="")

values <- data.frame(val = graph$values, Type = graph$labels, percent=percent_str, pos = graph$pos )

pie <- ggplot(values, aes(x = "", y = val, fill = Type)) + 
  geom_bar(width = 1,stat="identity") + 
  geom_text(aes(x= "", y=pos, label = val), size=3) 
pie + coord_polar(theta = "y")
Run Code Online (Sandbox Code Playgroud)

输出: MyOutput中

我读了这些主题,但没有成功:

r ggplot2

3
推荐指数
1
解决办法
1547
查看次数

Pandas合并两个具有相同行数的数据集

我有两个具有相同行数的表(第二个表是通过处理T1内的文本从第一个表计算出来的).我把它们都存储为pandas dataframe.T2与T1没有共同列.这是一个例子,因为我的表很大:

T1:
| name  | street  | city   |
|-------|---------|--------|
| David | street1 | Prague |
| John  | street2 | Berlin |
| Joe   | street3 | London |

T2:
| computed1 | computed2 |
|-----------|-----------|
| 0.5       | 0.3       |
| 0.2       | 0.8       |
| 0.1       | 0.6       |

Merged:
| name  | street  | city   | computed1 | computed2 |
|-------|---------|--------|-----------|-----------|
| David | street1 | Prague | 0.5       | 0.3       |
| John …
Run Code Online (Sandbox Code Playgroud)

python pandas

3
推荐指数
2
解决办法
4541
查看次数

Bash - 从数组传递参数

我使用bash来调用用java(gatk)编写的工具,我需要从数组中传递多个参数作为输入参数.我试过这种方式,但似乎没有用.你能帮帮我,怎么解决?

码:

java $GATK \
    -T GenotypeGVCFs  \
    -R $ref \
    -o output.vcf \
    for foo in array
    do
        --variant  $foo \
    done
Run Code Online (Sandbox Code Playgroud)

我想要的是什么:

java $GATK \
    -T GenotypeGVCFs  \
    -R $ref \
    -o output.vcf \
    for foo in array
    do
        --variant  file1 \
        --variant  file2 \
        --variant  file3 ...etc
    done
Run Code Online (Sandbox Code Playgroud)

编辑:对不起误解

array=("file1","file2","file3"...)
Run Code Online (Sandbox Code Playgroud)

谢谢

bash

2
推荐指数
1
解决办法
84
查看次数

标签 统计

bash ×1

ggplot2 ×1

pandas ×1

python ×1

r ×1