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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:12:35+00:00 2026-06-04T17:12:35+00:00

I wish to have multiple maps showing point values in Auckland, NZ. The problem

  • 0

I wish to have multiple maps showing point values in Auckland, NZ. The problem is that I have a background shapefile (land) to add background detail to the map which means that the free scale x y scales to the whole Auckland Region rather than the points spatial extent.

So my question is: How do I achieve varying spatial extents based purely on the point layer and get facet_wrap to ignore the others?

Here is the current code:

map1 <- ggplot(walk, 
           aes(x=coords.x1, y=coords.x2, colour=UD_TOTAL, size=UD_TOTAL)
           ) +
      scale_colour_gradient(low="#003300", high="#00FF00", space="rgb") + 
      opts(panel.background=theme_rect(fill="#404040", colour = "#404040")) +
      quiet +
      pland + 
      geom_point() +
      facet_wrap(~School2, ncol=3, scales='free') 

map1

NB: This map is an attempt to mimic http://spatialanalysis.co.uk/2012/02/great-maps-ggplot2/

Beginner so unfortunately I am unable to post images.

  • 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-06-04T17:12:36+00:00Added an answer on June 4, 2026 at 5:12 pm

    Thanks to advice from Charlotte Wickham I have found the new feature ‘annotation_map’ which facet wrap ignores. I did not spot it in my research through the book but is found here: http://cran.r-project.org/web/packages/ggplot2/ggplot2.pdf.

    The updated code is:

    map1 <- ggplot(walk2, 
            aes(x=coords.x1, y=coords.x2, colour=UD_TOTAL, size=UD_TOTAL)) + 
            scale_colour_gradient(low="#003300", high="#00FF00", space="rgb") + 
            opts(panel.background=theme_rect(fill="#404040", colour = "#404040")) +
            annotation_map(BuiltEnv, fill="#4F4F4F", colour="#4F4F4F") +
            geom_point() +
            facet_wrap(~School2, ncol=3, scales='free') +
            coord_map(project="mercator")
    map1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the presumably common problem of having elements that I wish to place
I have an XElement (myParent) containing multiple levels of children that I wish to
I have multiple 'bars' which I wish to resize and drag along a x-axis.
I wish to have a page that has a fixed height (without scroll bars).
Here is i wish to do. I want to have multiple webview loading their
I have multiple NSStrings and i wish to merge them into one other, here
I'm designing a website that is going to have multiple nested divs for the
Is there a field in django that can have multiple foreign key fields? I
I wish to have a home page with various widgets on them that display
I wish to construct a date format that will optionally have a time argument.

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.