Show the value of a geom_point using geom_text

前端 未结 2 742
醉梦人生
醉梦人生 2020-12-20 08:21

Using this nice code from here:

countries <- structure(list(country = structure(c(5L, 6L, 3L, 4L, 10L, 8L, 
11L, 7L, 1L, 13L, 9L, 12L, 2L), .Label = c(\"A         


        
2条回答
  •  心在旅途
    2020-12-20 08:53

    You're missing the data parameter in your geom_text:

    p + geom_text(data = countries, aes(label=Value, x=Longitude, y=Latitude), hjust=0, vjust=0)
    

提交回复
热议问题