0

I am trying to put labels using Geom Text. If i use geom_text, i cant see all values. But if i use geom_text_repel, i see all values with duplication. The purpose is to see label all the unique values without any duplication. Can anyone please tell me how it will be done ?

 library(ggrepel)
 library(ggplot2)
 rr <- ggplot(data = staypoint6, aes(staypoints.Stayplon, 
 staypoints.staypLat))+
 geom_line(alpha = 0.5, size = 2, shape = 16,  width = 0.000003, height = 
 0.000003, colour ="darkgoldenrod4") +  coord_fixed (ratio = 2) +
 labs(x ="Longitude", y = "Latitude") +
 theme(axis.title = element_text(size=14), 
     panel.background = element_rect(fill = "white",size = 0.5, linetype = "dotted"),
     panel.grid.major = element_line(size = 0.5, linetype = 'dotted',colour = "black"), 
     panel.grid.minor = element_line(size = 0.5, linetype = 'dotted',colour = "black"),
     panel.border = element_rect(colour = "black", fill=NA, size=0.5),
     axis.text.y   = element_text(size=12),
     axis.text.x   = element_text(size=12)) +  geom_text(aes(label = 
     Location_ids), colour = "dodgerblue4", size=6)

   rr + geom_text(aes(label = paste0("(", staypoint6$arri_time, ",", 
   staypoint6$lev_time, ")")), check_overlap = FALSE, size=4, hjust=0.15, 
   vjust=2)

enter image description here

   rr + geom_text_repel(aes(label = paste0("(", staypoint6$arri_time, ",", 
   staypoint6$lev_time, ")")), check_overlap = FALSE, size=4, hjust=0.15, vjust=2)

enter image description here

Saara
  • 105
  • 12
  • 1
    please edit your original question instead of posting a new one – pogibas Oct 24 '17 at 12:37
  • This is another issue. Original question was solved. – Saara Oct 24 '17 at 12:42
  • how could we know? Please edit your original question and respond to people that are helping you – pogibas Oct 24 '17 at 12:44
  • It has been marked duplicated by someone. I deleted that question. – Saara Oct 24 '17 at 12:46
  • 2
    Please post the output of `dput(staypoint6)`. Without the data, we can't be sure what's wrong. If `staypoint6` is too large to include, then boil it down to a small subset that recreates the problem. You might even solve it yourself while doing this. – Nathan Werth Oct 24 '17 at 13:21

0 Answers0