I\'m trying to plot some overlapping density plots in ggplot2. I\'m running into a problem where I cannot remove the diagonal slash from the legend. I have tried using scale
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.