ggnewscale

Stacked bar plot with multiple or different legend for each group

半世苍凉 提交于 2020-06-27 16:25:28
问题 Is it possible to generate a barplot like in the following link using ggplot? https://photos.app.goo.gl/E3MC461dKaTZfHza9 here is what I did library(ggplot2) df <- read.csv(text= "trt,gene,freq,cols M6,ALDH16A1,100.0000000,red M6,Others,0.0000000,lightgrey M12,ALDH16A1,64.6638015,red M12,GBE1,2.0074865,#4C00FF M12,ZNF598,1.5832525,#004CFF M12,CHMP6,1.3503397,#00E5FF M12,C20orf27,1.2033828,#00FF4D M12,NEGR1,0.9676972,#4DFF00 M12,TNFAIP6,0.9122418,#E6FF00 M12,ZSCAN25,0.7375572,#FFFF00 M12,BCL2