How to show an image instead a text like a label with ggplot2 and R?

Viewed 679

I have created a graphic with ggplot2 and I would like to know if its possible to put an image and how instead of a label using ggplot2.

My code:

ggplot(data, aes(x=DRTG, y=ORTG)) +
  geom_point(colour = "#000000") + 
  ggtitle("Gráfico Liga DIA: Ratio Ofensivo / Ratio Defensivo (hasta jornada 8)") +
  #geom_text(label=rownames(data), colour = "#000000", nudge_x = nudgeX, nudge_y = nudgeY, size = 4, fontface = "bold", check_overlap = F) +
  geom_text_repel(label=rownames(data), fontface = "bold") +
  geom_point(data=pointMedia, aes(x=mediaDRTG, y=mediaORTG, colour="red", size = 1)) + 
  geom_vline(xintercept = pointMedia[, "mediaDRTG"], colour = "green") + 
  geom_hline(yintercept = pointMedia[, "mediaORTG"], colour = "blue") +
  geom_text(data=pointMedia, aes(x=mediaDRTG, y=mediaORTG, label="Liga DIA"), nudge_x = 0, nudge_y = 1, colour = "red", fontface = "bold") +
  theme(legend.position = "none") +
  geom_abline(intercept =0 , slope = 1, colour = "orange")+ xlim(70,115) + ylim(70,115)

My graphic:

enter image description here

0 Answers
Related