How can I remove the legend title in ggplot2?

前端 未结 6 513
面向向阳花
面向向阳花 2020-12-13 17:17

I have a question concerning the legend in ggplot2.

Say I have a hypothetical dataset about mean carrot length for two different colours at two farms:



        
6条回答
  •  無奈伤痛
    2020-12-13 17:35

    I found that the best option is to use + theme(legend.title = element_blank()) as user "gkcn" noted.

    For me (on 03/26/15) using the previously suggested labs(fill="") and scale_fill_discrete("") remove one title, only to add in another legend, which is not useful.

提交回复
热议问题