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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:06:48+00:00 2026-06-05T21:06:48+00:00

I have several file with the following format: lat,lon,value. I would like to plot

  • 0

I have several file with the following format: lat,lon,value. I would like to plot a colored grid map with such value for each one of the lat,lon point and overlapping it over the EU map.

Thanks for support.

  • 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-05T21:06:50+00:00Added an answer on June 5, 2026 at 9:06 pm

    There are roughly two options: one using the lattice and sp package and the other using the ggplot2 package:

    lattice / sp

    First you have to transform your data to a SpatialPixelsDataFrame (provided by the sp-package), assuming your data is called df:

    require(sp)
    gridded(df) = c("lat","lon")
    

    and then plotting:

    spplot(df, "value")
    

    overlaying additional information such as country boundaries can be done using the sp.layout argument:

    spplot(df, "value", sp.layout = list("sp.lines", cntry_boundaries))
    

    where cntry_boundaries is a SpatialLines(DataFrame), or SpatialPolygons(DataFrame). Reading a polygonset into R can be done using the rgdal package, or the maptools package (readShapeLines).

    ggplot2

    I personally prefer using ggplot2 over spplot. ggplot2 is more flexible and has a more clear syntax. Note that ggplot2 works with normal data.frame‘s, and not with the spatial objects of the sp-package.

    A minimal example would look something like:

    ggplot(aes(x = lat, y = lon), data = df) + geom_tile(aes(fill = value)) + 
        geom_path(data = cntry_boundaries)
    

    For more information see these earlier answers of mine:

    • Plotting interpolated data on map
    • Average values of a point dataset to a grid dataset
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several UIViews that are on my xib file and would like to
I have a text file with several lines in the following format: gatename #outputs
I have several javascript files and I'd like to combine them into one file
I have an Eclipse plugin project that has several file resources that I would
So I have several lines in a file that looks like this useradmin:$NT$asdlfkjwaeroisglkwerlkj23424tlj::: useradmin:c2q3r4lsdfk23rlsdfkj3rjsdflk2k23:::
I have several textboxes in my aspx file (not nested in any other controls),
I have several batch files that I call from a parent batch file. I
I have several small classes that are in a single file in /app/models, similar
I have Course's model and the course consist of several file (stored only link
I have written a WinForms application (C# 2.0, VS2008) that registers several file types

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.