Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ggplot2]

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

3
votes
1answer
2k views

How do I create a heatmap in ggplot?

I'm using R with ggplot2 to generate maps from shapefiles and from data in SQL Server. I'm trying to get to a stage where I can automate a large chunk of the mapping I do. So far this is working well ...
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/...
6
votes
0answers
1k views

Using stat_density2d with coord_map in ggplot2 [closed]

In my example I am plotting a shapefile for all England & Wales, however I'm interested in the greater London area. If I allow ggplot to simply default and display the entire shapefile then the ...
5
votes
1answer
858 views

Creating an sf object from the maps package

I am trying to use data from the maps package in an sf workflow. I'm not sure if I have the operation correct (see below). It seems to work until state 20 (massachusetts). What am I doing wrong? Maybe ...
5
votes
1answer
441 views

Use “facet_wrap” in ggplot2 with QGIS?

I'm using QGIS 2.6.1 and R version 3.2.2. I'm struggling to get the syntax on a R Script for creating plots via QGIS processing to work. My understanding is that R syntax in QGIS Processing is ...
4
votes
2answers
807 views

Overlaying a polyshape to faceted maps in R with ggplot?

I have managed to create a faceted map from my data following the approach proposed here http://spatial.ly/2013/12/introduction-spatial-data-ggplot2/ with the following code: ggplot(data = plot.data,...
6
votes
1answer
1k views

Plotting data without geographical coordinates besides the main map in ggplot2

I am trying to plot some data as a bubble chart on the world map using ggplot2 package in R. I am able to proceed as follows. # Load necessay packages library(ggplot2) library(rworldmap) library(...
3
votes
1answer
549 views

Tearing of polygons using ggmap and readOGR

I'm trying to incorporate a shapefile of US states with ggmap and keep getting "tearing" of my polygons. I tried changing group=id to group=group which helped, but didn't seem to resolve the boundary....
2
votes
1answer
812 views

Trouble adding proportional circles on top of symbolized polygon in ggplot2 map

Data: Zipped ea.ml1 shapefile can be found here, and the country outline can be downloaded here at the GADM site. I've been using the Ethiopia ESRI shapefile. Branch locations are here. Per the ...
0
votes
2answers
921 views

raster::plot() plotting raster too small- is there an alternative on ggplot?

I am trying to plot this raster on R. The object is quite big, but when plotting it using the raster::plot() function, I obtain a very tiny image, as attached. The code I use to produce it is the ...