Suppose we have the following set of points in 2 groups (my_data). I want to plot a small dot over a larger triangle and assign different colors to triangles by group. The code below makes the plot just fine. I'm struggling to make legend symbols larger but setting different sizes for the triangles and different for the dots. override.aes size argument makes everything larger . Is there a way to set different sizes to make the symbol larger to follow the plot appearance..??...Thanx in advance.
my_data <- data.frame(x = sample(3592185:3850502, 10), y = sample(4104561:4258891, 10), var = c("A","A","B","A","A","A","B","A","B","A"))
ggplot() +
geom_point(data=my_data, aes(x = x, y = y, colour = var, shape = var, fill = var), stroke = 0.4) +
scale_shape_manual("",values=c(24,24)) +
scale_color_manual("",values=c("gray30", "steelblue")) +
scale_fill_manual("",values=c("gray90", "lightblue")) +
geom_point(data=my_data, aes(x = x, y = y, fill = var), color = "black", shape = 16, size = 0.2) +
guides(fill = guide_legend(override.aes = list(size = c(4,4)))) +
labs(title = NULL, x = NULL, y = NULL)