[英]ggplot2 avoid boxes around legend symbols
考慮下面的示例圖。 我想使圖例中每個符號周圍的小框消失。 我該怎么做?
ggplot(mtcars, aes(wt, mpg, shape=factor(cyl))) + geom_point() + theme_bw()
您正在尋找:
+ opts(legend.key = theme_blank())
您可以在?opts
看到很多有關此類內容的示例。 我不記得是哪一個,所以我只試了幾次,直到我弄對了。
注意 :由於版本0.9.2 opts
已替換為theme
:
+ theme(legend.key = element_blank())
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.