ggtreeExtra icon indicating copy to clipboard operation
ggtreeExtra copied to clipboard

geom_fruit support pie chart ?

Open StickHu opened this issue 2 years ago • 1 comments

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

StickHu avatar Dec 07 '23 09:12 StickHu

Hello, I have the same query, do you think its possible to convert add pie chart in "geom_fruit"? Thank you

jk00ANI avatar Oct 21 '24 15:10 jk00ANI