Problem Removing Border Lines in Maps Package

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem Removing Border Lines in Maps Package

ajdamico
I'm working with the nationwide county maps data, and trying to remove the
internal county boundary lines.  The only map() function parameter that I've
found that gets me anywhere close to my desired result leaves small white
segments on parts of the map.  I believe this is due to the low resolution,
because when I look at individual states, the lty parameter solves the
problem.  Does anyone have any idea how I might draw a United States county
map without these white borders making the map look sloppy?

library(maps)

#county map of new jersey, with invisible county borders -- correct example
map("county","new jersey", fill=TRUE , col=palette() , lty=0)

#county map of the united states, with white county borders still visible
some places
map("county", fill=TRUE , col=palette() , lty=0)

Thanks

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Problem Removing Border Lines in Maps Package

Greg Snow-2
If you don't want the county boundaries, then don't use the county map.  There is the state database that does not have county information.

If you want the counties different colors, but no dividing lines, then you may want to try the maptools and sp packages (shapefiles for the states/counties is available on the web) which use a different algorithm for storing and drawing the maps and will let you draw the outlines in the same color as the fill.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[hidden email]
801.408.8111


> -----Original Message-----
> From: [hidden email] [mailto:r-help-bounces@r-
> project.org] On Behalf Of Anthony Damico
> Sent: Saturday, October 24, 2009 12:40 PM
> To: [hidden email]
> Subject: [R] Problem Removing Border Lines in Maps Package
>
> I'm working with the nationwide county maps data, and trying to remove
> the
> internal county boundary lines.  The only map() function parameter that
> I've
> found that gets me anywhere close to my desired result leaves small
> white
> segments on parts of the map.  I believe this is due to the low
> resolution,
> because when I look at individual states, the lty parameter solves the
> problem.  Does anyone have any idea how I might draw a United States
> county
> map without these white borders making the map look sloppy?
>
> library(maps)
>
> #county map of new jersey, with invisible county borders -- correct
> example
> map("county","new jersey", fill=TRUE , col=palette() , lty=0)
>
> #county map of the united states, with white county borders still
> visible
> some places
> map("county", fill=TRUE , col=palette() , lty=0)
>
> Thanks
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Problem Removing Border Lines in Maps Package

Ray Brownrigg-2
In reply to this post by ajdamico
Have a look at:
map("county", fill=TRUE , col=palette() , resolution=0, lty=0)

HTH,
Ray Brownrigg

Anthony Damico wrote:

> I'm working with the nationwide county maps data, and trying to remove the
> internal county boundary lines.  The only map() function parameter that I've
> found that gets me anywhere close to my desired result leaves small white
> segments on parts of the map.  I believe this is due to the low resolution,
> because when I look at individual states, the lty parameter solves the
> problem.  Does anyone have any idea how I might draw a United States county
> map without these white borders making the map look sloppy?
>
> library(maps)
>
> #county map of new jersey, with invisible county borders -- correct example
> map("county","new jersey", fill=TRUE , col=palette() , lty=0)
>
> #county map of the united states, with white county borders still visible
> some places
> map("county", fill=TRUE , col=palette() , lty=0)
>
> Thanks

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Problem Removing Border Lines in Maps Package

jour4life
In reply to this post by Greg Snow-2
I'm sorry to ask this silly question so long after you posted this response. But I have also been trying to do this. What is the option to draw the outlines the same color as the fill? I'm also using the "spdep" and "maptools" libraries. I have shapefiles for Mexico (counties and read in the spatial lines for the states).

This is the code I've been trying to use to plot the map:
plot(mex, col=cols[findInterval(mex$nrr95, brks$brks, all.inside=F)], border=0)

I know that if I save this plot as a .pdf, the picture will come out fine. However, the file that is saved comes out to be far too large. This is probably due to the fact that there are so many counties in the shape file. And, as the person who asked the original question stated, the resolution of the pdf is higher and, thus, the picture comes out pretty good.

But, I want to save these maps as picture files. Would I have to put any other option after the "border=0" option?

Thanks,

Carlos