locator equivalent in ggplot2 (for maps)
Note: This question is specific for mapping but I'd like to be able to use it when I plot in a standard Cartesian coordinate system. I love base graphics but also like ggplot2 for many things. One of my most used base functions for fine tuning a graph is locator(n) but this produces an error in ggplot2. library(ggplot2) county_df <- map_data('county') #mappings of counties by state ny <- subset(county_df, region=="new york") #subset just for NYS ny$county <- ny$subregion ggplot(ny, aes(long, lat, group=group)) + geom_polygon(colour='black', fill=NA) locator(1) Now grid.locator() as pointed out
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.