I have the following graph:
dat<-data.frame(name=c("a","b","c"), x=1:3, y=1:3)
ggplot(dat, aes(x=x, y=y))+
geom_point(aes(shape=paste(1:3,": point",name)))+
geom_text(aes(x=x,y=y+0.07), label=1:3)+
scale_shape_manual(values=rep(1,3))+
labs(shape="locations")
I need to add the points to ggmap, however when i get rid of ggplot and start with : geom_point(dat, aes(x=x, y=y,shape=paste(1:3,": point",name)))+
I get an error"Error: Discrete value supplied to continuous scale"
ggplot(dat, ...)
definesdat
as the default dataset, referenced in all the following geom_* calls. If you move that togeom_point(data=dat,...)
, thengeom_text(...)
does not know what to use for data. Can you provide a more complete question which shows the use ofggmap(....)
– jlhoward