put the legen in right in ggplot1 2 in R code example Example: ggplot put legend in plot p + theme(legend.position = c(0.8, 0.2))