Questions tagged [ggplot2]

Use this tag when referring to the R package for high level data visualization and mapping.

19 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
2k views

How to prevent cross-world lines in ggplot world map?

I'm having issues displaying 'great circles' paths and polygons in ggmap, an extension of ggplot2. Please enter the following code to replicate my issues: https://gist.github.com/Robinlovelace/...
4
votes
0answers
1k views

Fortifying re-projected shapefile for ggplot2 in R

I have a shapefile of US county boundaries which I got from the NHGIS. I can load the file using the rgdal package and see information about it: library(rgdal) shp_1860 <- readOGR("shp", "...
3
votes
0answers
36 views

smearing in Linux, but not in Windows

I must have a Linux library out of wack since the following image has "smears" on the colors. Is there a better term? On my Windows 7 RStudio it works fine. this image is from a Ubuntu 16.04 LTS ...
2
votes
0answers
38 views

Assign different colours to intersection between two polygons and difference area

I am quite new to GIS using R. I have two sets of data, upon which I could create two polygons like this: What I want to do is colour the common area (inner 'circle') and the space between borders. ...
2
votes
0answers
135 views

Plotting gam spatial estimates over map?

I have imported Italy map with the following code: library(ggplot2) library(mgcv) library(ggmap) Country <- "Italy" Get_Map_Country <- get_map( location = Country , zoom = 6 ,...
2
votes
0answers
303 views

About shp for ggmap in the R

I am a new in R and GIS, so I kindly ask you on advice. I had a shp which I want to plot on google map. The shpfile is here: http://www.filedropper.com/exercisestanddata First I do this: ogrInfo(...
1
vote
0answers
22 views

Union anti-meridian “multipolygons” after re-centering world map

My goal is to create a world map (using ggplot2) with a Pacific perspective. I have managed to re-center the map, by following this solution. Code below: # world country layer sppolys <-...
1
vote
0answers
105 views

R colored raster from QGIS to ggplot or tmap

I am fairly new in doing GIS work in R, but I thought this would be a nice situation to get my feet wet. Here is the situation: I need to create multiple plots with the same background, the same ...
1
vote
0answers
128 views

could not find function “merge_eurostat_geodata”

Just a couple of codes with the same error at the time of merge data: FIRST CODE: library(eurostat) library(dplyr) library(ggplot2) library(stringr) fer <- search_eurostat("fertility") ...
1
vote
0answers
48 views

How to group different values of a variable so that they plot with same shape?

I have a table with two columns of number X and Y, and one column of strings called crystals. crystals A A B C B D B C Using ggplot2, how can I make a scatter plot of X versus Y with two ...
1
vote
0answers
173 views

ggmap with Gauss Krueger coordinates

I am using R for doing a map of groundwater levels which means I have some measurements at some coordinates in the Gauss-Krueger system and I interpolated between these measurements. I want to plot ...
1
vote
0answers
247 views

Sub setting shapefile to plot a region and addressing mismatch in ggplot & data

I am plotting India's district map with data (cases). First I read data for each district and district shapefile. Later I merge the two on district. Using fortify data I get ggplot. I get a beautiful ...
1
vote
0answers
88 views

How to solve coordinate differences between packages

I have two maps generated by two different methods. The first, I used maps package and the function map() and symbols(). On the other hand, I used the ggmap package with the ggmap() and geom_point() ...
1
vote
0answers
801 views

Trying to Create a Global Choropleth Population Density Map then add Biodiversity Level

I am trying, quite unsuccessfully, to create a global choropleth population density map for a specific 120 countries, using ggplot2. Once I have created this choropleth map, I want to add number of ...
0
votes
0answers
18 views

Polygon boundary is not properly connected in R

I have two points sets, when plotted using geom_point, they look like: What I want to do is draw a polygon using these two datasets, and I expect to get a ring-shape polygon. However, when I use ...
0
votes
1answer
27 views

Order features in a spatialpolygonsdataframe in ggplot2

I have a spatialpolygonsdataframe with many overlapping features. I want to create a map in which the smaller features are displayed on top of the larger ones so that the small ones aren't fully ...
0
votes
1answer
30 views

Plotting Geographical Grid from Long/Lat Coordinates in R

I have a file of coordinates (Long/Lat) that should enable me to plot a series of 10km grid squares covering the UK. However, for each grid square I have five sets of coordinates by way of plotting ...
0
votes
1answer
165 views

Simplifying a SpatialPointsDataFrame in ggplot world

I've been working on a map showing lines running across Europe. Each line is coming from a GPX file, parsed in like so: spdf <- readOGR("data/file.gpx", layer = "track_points") Now, if I plot the ...
0
votes
1answer
80 views

Combining postal codes into sales territories by value using R and ggplot2?

I have the shapefile for Canadian census subdivisions. For each subdivision I calculated some value (someValue). I want to combine census subdivisions into territories in such a way that territories ...