R/g_legend.R

Defines functions g_legend

#
#
#
#
#
#

#取出ggplot的legend
g_legend<-function(a.gplot){
  tmp <- ggplot_gtable(ggplot_build(a.gplot))
  leg <- which(sapply(tmp$grobs, function(x) x$name) == "guide-box")
  legend <- tmp$grobs[[leg]]
  return(legend)
  }
hsiujho/BacteriaIden documentation built on May 17, 2019, 5:55 p.m.