Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6974705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:16:21+00:00 2026-05-27T17:16:21+00:00

I would like to represent multiple counties in TN state as a single region

  • 0

I would like to represent multiple counties in TN state as a single region using a common color fill. I can do that with the code below:

library(maps)
map("state", "tennessee", fill = TRUE, col="white", names = TRUE, plot = TRUE)
co <- map("county",region = c("tennessee,williamson","tennessee,davidson",
                         "tennessee,wilson","tennessee,cheatham"),
       col = "red", bg = "blue", fill = TRUE, plot = FALSE)
polygon(co$x, co$y, col = "yellow", border = "black")

But the black borders are drawn inside my region of interest. Is there a way to define the polygon function such that common county borders are not drawn in black?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:16:22+00:00Added an answer on May 27, 2026 at 5:16 pm
    • To get the outside border of the whole ROI, you need a call to map.poly() with as.polygon=FALSE, and then plot this with lines().
    • To get the solid inside fill you need a call to map.poly() with as.polygon=TRUE and then plot this with polygon() and border=FALSE.

    You can see this if you look through the code of map by just entering it at the command line and hitting enter.

    Here is the code I used to get what you want:

    map("state","tennessee",fill=T,col="white",names=T,plot=T)
    coords = map.poly("county",region=c("tennessee,williamson","tennessee,davidson","tennessee,wilson","tennessee,cheatham"), boundary=T, interior=F, fill=F, as.polygon=T)
    polygon(coords, col='red', border=F)
    map("county",region=c("tennessee,williamson","tennessee,davidson","tennessee,wilson","tennessee,cheatham"),fill=F,interior=F,add=T)
    

    enter image description here

    From reading ?map, I thought simply doing something like map(..., interior=F, fill=T, col='red') would work, but this doesn’t seem to do it. Could be a bug, but I haven’t played with this package enough to know for sure…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have around 3500 flood control facilities that I would like to represent as
I have a multiple ModelForm classes that each represent a different Model. I would
I would like to represent a datatype as a single column in my model,
I have an array of integers which represent a RGB image and would like
I have a string that represents a non indented XML that I would like
Would like to get a list of advantages and disadvantages of using Stored Procedures.
Would like to make anapplication in Java that will not automatically parse parameters used
Would like to know the c# code to actually retrieve the IP type: Static
I have multiple text files that represent logging entries which I need to parse
I'd like to be able to print to the same line, while using multiple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.