[R] ggplot map bounds
izahn at psych.rochester.edu
Mon Nov 1 16:25:44 CET 2010
usamap + xlim(c(-85, -75)) + ylim(c(33,37))
will do what you want.
On Mon, Nov 1, 2010 at 10:52 AM, Adrienne Wootten <amwootte at ncsu.edu> wrote:
> To all,
> I'm working with code below to produce a map with station data plotted in
> points, but right now I'm having trouble with the mapping portion of this
> states <- data.frame(map("state", plot=FALSE,xlim=
> usamap<- ggplot(states)+geom_path(aes(x,y))
> When I plot this the problem is that the bounds of the plot is from 31N to
> 38N and 90W to 75W. The problem is that I only need the bounds of the plot
> to be from 33N to 37N and 85W to 75W. The way this is now, if I try to
> subset the states object, I get a garbled mess of lines. The rest of the
> code provides what I'm trying to do with the attached data.
> usamap + geom_point(data=obsmeans,aes(x=lon,y=lat,colour = month_1),size=5)
> Any ideas for how I can fix this map would be appreciated!
> Adrienne Wootten
> Graduate Research Assistant
> State Climate Office of North Carolina
> Department of Marine, Earth and Atmospheric Sciences
> North Carolina State University
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
University of Rochester
Department of Clinical and Social Psychology
More information about the R-help