library(ggplot2)
# Plot where colour and fill would normally merge
p <- ggplot(mtcars, aes(mpg, wt, color = factor(cyl), fill = factor(cyl))) +
geom_point(shape = 21, size = 3, stroke = 1.5) +
labs(color = "Cylinders", fill = "Cylinders")
# Force separate legends
p + legend_split(colour, fill)
Run the code above in your browser using DataLab