0

I want to modify the "twitter, Weibo and Github" colors in the legend based on their colors in the graph, as I want to add their names in the legend.

dataff <- data.frame(x=c(5,18,3),
                     y=c(12,9,2),
                     label=fontawesome(c('fa-github', 'fa-weibo', 'fa-twitter')),
                     taa = c("github", "weibo", "twitter"))

ggplot(dataff, aes(x, y, color=label, label=label)) +
  geom_text(family='fontawesome-webfont', size=6)+
  xlab(NULL)+ylab(NULL) +
  theme(legend.text=element_text(family='fontawesome-webfont'))

enter image description here

stefan
  • 46,681
  • 5
  • 18
  • 35

0 Answers0