gravatar for zx8754

1 hour ago by

London

We can achieve the same using basic ggplot, see example:

library(ggplot2)

#example data
df1 <- data.frame(
  x = 1:10,
  y = 1:10,
  grp = rep(LETTERS[1:2], 5)
)

ggplot(df1, aes(x, y, col = "black", fill = grp, shape = grp)) +
  geom_point() +
  scale_color_identity() +
  scale_fill_manual(values = c("red", "green")) +
  scale_shape_manual(values = c(21, 24)) +
  theme_classic()

We need to use shapes that can have colour and fill separately: www.sthda.com/english/wiki/r-plot-pch-symbols-the-different-point-shapes-available-in-r



Source link