r - ggplot puts bended segments upon map created with ggmap -
i'm plotting geom_segment upon map using ggmap in following code:
rm(list=ls()) library(ggmap) library(ggplot2) library(grid) data <- data.frame(point=c("one"), latitude=c(-20),longitude=c(-25), latitude_end=c(50),longitude_end=c(50),sample=c("one")) map <- get_map(location=c(-20,-10,55,30), zoom = 3, maptype = "terrain", scale = 2) p0 <- ggmap(map, size=c(100, 200), extent="device", legend="bottom") p1 <- p0 + geom_segment(data=data, aes(x=longitude, y=latitude, xend=longitude_end, yend=latitude_end), colour="black") + geom_point(data = data, aes(x =longitude, y = latitude), size=3,shape = 16) png("plot.png") p1 dev.off()
the bend slight, , notice there (or put straight on monitor), creates horrible aesthetic effect once more lines added. possible force straight line on top of map?
sidenote: possible embed vignette text @ end extreme text (data$sample)?
Comments
Post a Comment