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 980021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:18:46+00:00 2026-05-16T04:18:46+00:00

how do I plot an area around a set of points on a map

  • 0

how do I plot an area around a set of points on a map in R? e.g.

map('world')
map.axes()
p <- matrix(c(50, 50, 80, 100, 70, 40, 25, 60), ncol=2) # make some points
points(p, pch=19, col="red")

polygon(p, col="blue")

… which gives me a polygon with a vertex at each of the points, but it looks rather crappy. Is there any way to “smooth” the polygon into some sort of curve?

  • 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-16T04:18:47+00:00Added an answer on May 16, 2026 at 4:18 am

    One option is to make a polygon bounded by a Bézier curve, using the bezier function in the Hmisc package. However I cannot get the start/end point to join up neatly. For example:

    ## make some points
    p <- matrix(c(50, 50, 80, 100, 70, 40, 25, 60), ncol=2)
    ## add the starting point to the end
    p2 <- cbind(1:5,p[c(1:4,1),])
    ## linear interpolation between these points                            
    t.coarse <- seq(1,5,0.05)
    x.coarse <- approx(p2[,1],p2[,2],xout=t.coarse)$y
    y.coarse <- approx(p2[,1],p2[,3],xout=t.coarse)$y
    ## create a Bezier curve                                           
    library(Hmisc)
    bz <- bezier(x.coarse,y.coarse)
    library(maps)
    map('world')
    map.axes()
    polygon(bz$x,bz$y, col=rgb(0,0,1,0.5),border=NA)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do you find the location of the plot area of an axes in
How to set the background only in the plot area? I wahnt my chart
I am using a theme, but i want to set background color around the
I have a plot that has data that runs into the area I'd like
I am trying to plot graph in which i want to fill graph area
I want to plot a scatter plot with filled markers and make them semi-transparent
I'm using Microsoft's Chart control to plot some series, but if I have no
Is there any way in R to do a stacked area plot where the
How to change area gradient color for negative values in Gradient Scatter Plot in
Lets suppose I have n curves, which together enclose some region. How to plot

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.