Skip to content

geom_fruit support pie chart ? #31

@StickHu

Description

@StickHu

Hi, recently I was using the ggtreeExtra and jjPlot. However, I want to show the species abundance and prevalence of pie charts. Following are my R code

`# 添加注释信息
p_new <- p_tree + geom_fruit(data=new_annotation,
geom=geom_text,
mapping=aes(y=Species, x=Nich, label=Nich),
angle=0.1, size=3,
pwidth = 0.05,
offset=2)

pmerge <- p_new +
new_scale_fill() + #添加新的scale
geom_fruit(
data=merged_data,
geom=geom_jjPointPie,
mapping=aes(y=Species, x=Nich, group=seq, fill=Abundance, pievar=Frequency),
line.size=0,
width=0.2,
pwidth=0.08,
offset = 2
)+

scale_fill_manual(values = c("lightblue", "darkblue", "grey"))+

scale_fill_gradient(low = "lightblue", high = "darkblue") +
guides(color="none")+ #隐藏进化树分组图例
theme(
legend.justification = c("right", "top") #调整图例位置到右上角
)`

Failed to show the prevalence of each Species. Could you please give me some suggestions ?
Rplot.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions