0

I'm making a graph of a PCA in R using morphological data of distinct fishes and I'm using the package "factoextra" to make this plot. I runned the following code:

fviz_pca_ind(pca, axes = c(1:2), geom.ind = "point", pointshape = 21, 
             pointsize = 2, 
             fill.ind = data$spp, 
             col.ind = "black", 
             palette = "jco", 
             addEllipses = TRUE,
             label = "var",
             col.var = "black",
             repel = TRUE,
             legend.title = "Species") +
  ggtitle("") +
  theme(plot.title = element_text(hjust = 0.5))

Which had returned me the following graph:

Principal Component Analysis of Clueiformes morphology

My goal is to ill the clusters and the index of the graph with images of the respective fish specie instead of these colored points (These images are png's that I already have in my PC). How can I make it?

camille
  • 16,432
  • 18
  • 38
  • 60
  • OP, you can check [the answers to this question](https://stackoverflow.com/questions/2181902/how-to-use-an-image-as-a-point-in-ggplot) as a good reference. I would have tagged this as a duplicate of that, but none of the 3 answers are accepted. All present viable methods to show an image in the plot - my recomendation would be to use `ggimage` and `geom_image()`. – chemdork123 Jan 28 '22 at 19:21
  • 2
    Where are you trying to put the pictures, at the centroid of each cluster? Do you already have those points, or do you need a way to extract them? Regardless, I have a feeling this will become pretty cluttered & hard to read – camille Jan 28 '22 at 19:33

0 Answers0