如何使用ggplot2和R显示图像而不是像标签这样的文本?

时间:2017-11-24 10:02:17

标签: r ggplot2 ggrepel

我用ggplot2创建了一个图形,我想知道是否可以使用ggplot2放置图像以及如何代替标签。

我的代码:

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)

我的图片:

enter image description here

0 个答案:

没有答案