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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:18:47+00:00 2026-06-10T01:18:47+00:00

I am trying to plot geographical location on a map. I am using ggplot2

  • 0

I am trying to plot geographical location on a map. I am using ggplot2 in combination with maps libraries.

Everything is nice except for on region that is very crowded. I would like to make a zoom in on this region but I am not able.

So I would like to zoom on the Galapagos island.
Here is the script I have used:

library(ggplot2)
library(maps)

measurements <- read.csv("all_podo.count.csv", header=T)
allworld <- map_data("world")



d <- ggplot(measurements, aes(long, lat)) + 
geom_polygon(data = allworld, xlim = c(-50, 100), aes(x = long, y = lat, group = group),
colour = "grey70", fill = "grey70") +
geom_point(size = 0.7, shape = 8) + 
opts(axis.title.x = theme_blank(), 
axis.title.y = theme_blank()) +
geom_text(aes(label = name), size = 1, vjust = 0,  hjust = 0)
d

The measurements look like this:

structure(list(site_num = c(59L, 54L, 44L, 42L, 38L, 37L, 43L, 
39L, 36L, 40L, 34L, 35L, 33L, 41L, 32L, 31L, 30L, 29L, 28L, 27L, 
26L, 25L, 24L, 23L, 22L, 21L, 20L, 19L, 18L, 17L, 16L, 15L, 14L, 
13L, 12L, 11L, 10L, 7L, 8L, 9L, 1L, 3L, 6L, 5L, 79L, 77L, 78L, 
76L, 75L, 74L, 80L, 81L, 72L, 73L, 71L, 70L, 69L, 68L, 66L, 67L, 
65L, 63L, 64L, 62L, 60L, 61L), name = structure(c(44L, 43L, 42L, 
40L, 36L, 35L, 41L, 37L, 34L, 38L, 32L, 33L, 31L, 39L, 30L, 29L, 
28L, 27L, 26L, 25L, 24L, 23L, 22L, 21L, 20L, 19L, 18L, 17L, 16L, 
15L, 14L, 13L, 12L, 11L, 10L, 9L, 8L, 5L, 6L, 7L, 1L, 2L, 4L, 
3L, 64L, 62L, 63L, 61L, 60L, 59L, 65L, 66L, 57L, 58L, 56L, 55L, 
54L, 53L, 51L, 52L, 50L, 48L, 49L, 47L, 45L, 46L), .Label = c("GS000a", 
"GS000b", "GS000c", "GS000d", "GS001a", "GS001b", "GS001c", "GS002", 
"GS003", "GS004", "GS005", "GS006", "GS007", "GS008", "GS009", 
"GS010", "GS011", "GS012", "GS013", "GS014", "GS015", "GS016", 
"GS017", "GS018", "GS019", "GS020", "GS021", "GS022", "GS023", 
"GS025", "GS026", "GS027", "GS028", "GS029", "GS030", "GS031", 
"GS032", "GS033", "GS034", "GS035", "GS036", "GS037", "GS047", 
"GS051", "GS108a", "GS108b", "GS109", "GS110a", "GS110b", "GS111", 
"GS112a", "GS112b", "GS113", "GS114", "GS115", "GS116", "GS117a", 
"GS117b", "GS119", "GS120", "GS121", "GS122a", "GS122b", "GS123", 
"GS148", "GS149"), class = "factor"), lat = c(-15.143611, -10.131389, 
-1.9738889, 1.3891667, -0.3011111, 0.27222222, -0.020833334, 
-0.5938889, -0.2, -1.2283334, -1.2161111, -1.2169445, 1.2641667, 
-0.38305557, 5.552778, 5.64, 6.492778, 8.129167, 9.164444, 10.716389, 
18.036667, 20.5225, 24.174723, 24.488333, 32.506943, 36.003887, 
38.946945, 39.417778, 38.94, 41.09111, 41.485832, 43.63222, 45.111668, 
44.690277, 44.137222, 42.85278, 42.503056, 32.166668, 32.166668, 
32.166668, 31.175, 31.175, 31.175, 32.174835, -32.399166, -30.898333, 
-30.898333, -29.348888, -26.035, -23.21611, -6.3166666, -6.3166666, 
-4.613611, -4.613611, -4.635, -4.6625, -4.990278, -7.0075, -8.505, 
-8.505, -9.596945, -10.446111, -10.446111, -10.943611, -12.0925, 
-12.0925), long = c(-147.435, -135.44945, -95.014725, -91.81695, 
-91.651665, -91.63333, -91.19778, -91.06944, -90.83528, -90.42917, 
-90.422775, -90.319725, -90.295, -90.279724, -87.087776, -86.56528, 
-82.90389, -79.69111, -79.83611, -80.25445, -83.78472, -85.41361, 
-84.344444, -83.07, -79.263885, -75.39472, -76.41722, -75.504166, 
-74.685, -71.60222, -71.35111, -66.84722, -64.94666, -63.637222, 
-63.644444, -66.217224, -67.24, -64.5, -64.5, -64.5, -64.32433, 
-64.32433, -64.32433, -64.01017, 36.591946, 40.420277, 40.420277, 
43.215557, 50.123055, 52.30611, 39.009167, 39.009167, 55.50861, 
55.50861, 56.836113, 60.523056, 64.97667, 76.33139, 80.37556, 
80.37556, 84.1975, 88.30278, 88.30278, 92.05889, 96.88167, 96.88167
)), .Names = c("site_num", "name", "lat", "long"), class = "data.frame", row.names =     c(NA, 
-66L))

Can you help me ?

Thank you,

Simon

  • 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-10T01:18:49+00:00Added an answer on June 10, 2026 at 1:18 am

    This shows you that the world map on package maps is not particularly high resolution by the time you get down to the level of the Galapagos:

    if (require("maps")) { 
    world <- map_data("world") 
    mid_range <- function(x) mean(range(x)) 
    library(plyr) 
    ggplot(world, aes(long, lat)) + 
       geom_polygon( aes(group = group), fill = "green", colour = "red")+
       ylim(c(-2, 1 )) + xlim( c(-93,-88) ) }
    

    enter image description here

    There doesn’t seem to be a group with that name. I’m thinking yoou might want to find a better shapefile for this project.:

    grep(“Is”, unique(world$region), value=TRUE)
    1 “Israel”
    [2] “Marshall Islands”
    [3] “Solomon Islands”
    [4] “Cook Islands”
    [5] “South Sandwich Islands”
    [6] “Sonsorol Island”
    [7] “Maug Island”
    [8] “Pitcairn Islands”
    [9] “Isle of Man”
    [10] “Andaman Islands”
    [11] “Northern Mariana Islands”
    [12] “Madeira Islands”
    [13] “Sin Cowe Island”
    [14] “Paracel Islands”
    [15] “Falkland Islands”
    [16] “Cayman Islands”
    [17] “Virgin Islands”
    [18] “Canary Islands”
    [19] “Spratly Island”
    [20] “Isle of Wight”

    An RSeek search finds several links. One of them to :

    http://downloads.cloudmade.com/americas/south_america/ecuador/galapagos/galapagos.shapefiles.zip

    “All of the files at downloads.cloudmade.com are based on data from OpenStreetMap and are licensed under the terms of the Creative Commons Attribution Share-Alike 2.0 license. If you use these files please make sure you attribute the OpenStreetMap community by including a link to http://www.openstreetmap.org.:

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

Sidebar

Related Questions

I'm trying to plot heatmap in ggplot2 using csv data following casbon's solution in
I'm trying plot markers in a specific city using google Geochart when the region
I'm trying to plot MGRS lines over a map in an overlay using OpenLayers
I have a bunch of points that I am trying to plot using matplotlib.
I am trying to plot a graph using gnuplot. I have six text files.
I am trying to plot some data using pylab scatter function. I'm using pylab.scatter(X,
I am trying to plot using piecewise in one of my problems and I
When trying to plot a normal PDF with mean=0 and standard deviation=20 using the
I am trying to plot a ratio but my problem is that when the
I am trying to plot roots of a function that is composed of 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.