2012-07-21 2 views
6

을 ggmap 제가 아래 enter image description hereggplot에 화상을 저장 및

볼 ggsave 기능을 이용하여 영상을 저장하지만,이 enter image description here

 al1 <- get_map(location = c(lon = -86.304474, lat = 32.362563), zoom = 11, maptype = 'terrain') 

     lon<--86.304474 
     lat<-32.362563 
     df<-data.frame(lon,lat) 
     a+ggplot(df) 
     ggmap(al1)+geom_point(data=df,aes(x=lon,y=lat),size=2) 

같은 출력 제가 제거 X하려고 노력하고 싶은 y 축 값을하지만 문제는 패널에서 흰색 배경을 갖는 이미지이지만 단지 플롯 이미지 만 필요합니다.

답변

4

ggmap() 함수에서 extent = "device"이 필요합니다. 더 많은 옵션은 ?ggmap::ggmap을 참조하십시오.

다음은 원하는 결과를 제공합니다.

library(ggmap) 
al1 <- get_map(location = c(lon = -86.304474, lat = 32.362563), zoom = 11, maptype = 'terrain') 

lon<--86.304474 
lat<-32.362563 
df<-data.frame(lon,lat) 
     #a+ggplot(df) # Not sure what you intend here 
ggmap(al1, extent = "device")+geom_point(data=df,aes(x=lon,y=lat),size=2)