MDS plot graphics - issues with changing colours and shape for multiple variables gpplot2

I am having issues with ggplot2 graphics to display two variables (site and period) in my mds plot.

I would like to use the same symbols for sites but displaying them as unfilled for historical time periods but filled for contemporary periods using the same colour (black), instead of having to use grey as per the attached plot. Please can someone advise on how to use the same symbols in the same colour but filled and unfilled (for historical and contemporary)? I am using the following code below at the moment to produce the attached plot:

mds_all <- ggplot(mds.xy, aes(x = MDS1, y = MDS2)) +
  geom_point(aes(MDS1, MDS2, shape = site, colour = period, size = 2)) +
  coord_fixed() +
  theme_classic() +
  theme(panel.background = element_rect(fill = NA, colour = "black", size = 1, linetype = "solid"))+
  labs(colour = "Period", shape = "Site")+
  theme(legend.position = "right", legend.text = element_text(size = 12), legend.title = element_text(size = 5), axis.text = element_text(size = 5)) +
  scale_shape_manual(values = c(15, 16, 17, 18, 19)) +
  scale_colour_manual(values = c("Black", "grey")) 

Hi, from what I see here, you need to add a combination column (site.period) and then map the filled and unfilled shapes to it while removing the color = period argument.

I would give it a try with a reproducible example, so next time please upload a complete reprex. See here for more:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.