In the following plot:
library(ggplot2)
test <- data.frame(Depth=c(rep(c(0,10,20),4)),
Core=c(rep("A", 6), rep("B",6)),
Variable=c(rep("Treat1",3),rep("Treat2",3), rep("Treat1",3),rep("Treat2",3)),
Value=runif(12,0,1))
ggplot(test, aes(Value, Depth, col=Variable, shape=Core, lty=Core))+
geom_path(aes(group=interaction(Variable, Core))) +
geom_point(aes(group=interaction(Variable, Core)))+
theme_bw()+
guides(colour = guide_legend(aes.override=list(linetype = "solid")))
is it possible with remove the shapes from the colour-based legend (set to "Variable"), as i tried with aes.overide
in guides
?
My real life example produces this legend:
and I want to remove the shapes from the left legend; in fact I want to replace the current legend keys (lines and shapes) with filled boxes. Since the aes contains an interaction-argument, I fear my attempt to manipulate the legend via colour=guide_legend
is futile.