remove legend title in ggplot

前端 未结 5 1779
死守一世寂寞
死守一世寂寞 2020-12-23 02:45

I\'m trying to remove the title of a legend in ggplot2:

df <- data.frame(
  g = rep(letters[1:2], 5),
  x = rnorm(10),
  y = rnorm(10)
)

lib         


        
5条回答
  •  太阳男子
    2020-12-23 03:15

    For Error: 'opts' is deprecated. Use theme() instead. (Defunct; last used in version 0.9.1)' I replaced opts(title = "Boxplot - Candidate's Tweet Scores") with labs(title = "Boxplot - Candidate's Tweet Scores"). It worked!

提交回复
热议问题