How can I change the title of a ggplot2 legend?

后端 未结 4 741
小蘑菇
小蘑菇 2020-12-25 12:38

I was looking here but I can\'t figure it out.

How can I change the word \"type\" to something else?

4条回答
  •  梦谈多话
    2020-12-25 13:22

    Just a word to the wise ... all of these options above can be overridden if you do something dumb like I just did. Earlier in my project, I had simply turned off a legend I didn't like using the "themes" parameter within ggplot:

    theme(legend.title = element_blank())
    

    If you do this, no matter what beautiful commands you put in to change the title -- and I tried all of those above -- they won't be overridden by your command to turn the legend off! You have been warned! ;{)

提交回复
热议问题