ggplot2: how to remove slash from geom_density legend

我们两清 提交于 2019-11-28 20:22:39

Try this:

+ guides(fill = guide_legend(override.aes = list(colour = NULL)))

although that removes the black outline as well...which can be added back in by change the theme to:

legend.key = element_rect(colour = "black")

I completely forgot to add this important note: do not specify aesthetics via x=iris$Sepal.Length using the $ operator! That is not the intended way to use aes() and it will lead to errors and unexpected problems down the road.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!