Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
3 votes
2 answers
259 views

Fill Subdivisions of Chloropeth Map with multiple Colors

I want to create a plot of Germany, where each of its 16 Bundesländer (Subdivisons) is colored differently, depending on the fulfillment of a handful of criteria. At the bottom you find a ...
Frosi's user avatar
  • 319
0 votes
1 answer
73 views

Gradient fill shape file according to longitude

I'd like to have my map fill based on longitude (east-west), not a single colour, but can't seem to be able to specify the object value for fill as the shape file is a multipolygon. library(ggplot2) ...
Lilnet Cloud's user avatar
2 votes
2 answers
131 views

How can I change the background in a ggplot legend for a line aesthetic without changing other backgrounds?

I'm making a map with sf in ggplot2 with two sets of lines. One set of lines has a column of values that I'm matching to the "color" aesthetic. The other set of lines I want to all be white (...
thebenjaminp's user avatar
0 votes
1 answer
410 views

How to set plotting order of overlapping sf polygons

I have a set of overlapping sf polygons that I would like to plot on top of each other, the largest in the bottom and the smallest on top. This is default for SpatialPolygons, where the @plotOrder ...
Jon's user avatar
  • 58
2 votes
0 answers
171 views

Offsetting a polyline in one direction part II

This is a follow-up question from: Offsetting a polyline in one direction. Essentially, I still want to offset a polyline in one direction, but, since asking the original question, I have become more ...
teunbrand's user avatar
  • 36.9k
0 votes
1 answer
307 views

need to plot multiple spatial maps side-by-side in a single window using sf plot function in R

I like to plot all my 5 spatial maps of drought indices in a single window using sf plot function in R. I am able to plot all maps seperately but unable to plot altogether. All indexes are showing ...
RJ34's user avatar
  • 29
0 votes
1 answer
131 views

Create multiplot with map and scatter

I am trying to create multiplot that contains a map (using geom_sf) and a graph next to each other. I tried to use GGpubr::ggarrange and cowplot::plot_grid for this purpose. But I get this warning: 1: ...
Babak Fi Foo's user avatar
0 votes
2 answers
377 views

How to properly plot sf object

I have data like the following: These data are obtained from a Stata dataset (.dta exported to .csv) and are intended to plot a map of shapefiles. I import it into R, drop rows with missing data, and ...
bill999's user avatar
  • 2,443
1 vote
2 answers
793 views

plot geodata on the globe perspective in R

(how) is it possible to plot geodata – for example a polygon layer – on a globe with d3/perspective view, similar to this graphic on wikipedia? I'd like a solution with sf and ggplot most, but any ...
snaut's user avatar
  • 2,393
3 votes
1 answer
4k views

Change colours of filling and not just borders in geom_sf()

I am plotting a sf object (multipolygons). I which its geometries are filled with a colour according to each observations' value in the column cand_dummy. However, I have tried to change many things ...
AntVal's user avatar
  • 645
2 votes
1 answer
207 views

Plotting country shapefiles next to each other preserving scale

What I want to do Using country-level data from the Natural Earth shapefile dataset, I would like to plot countries next to one another to demonstrate their size difference. For example, I'd love to ...
Yasha's user avatar
  • 330
2 votes
1 answer
183 views

Customize labels on a color key using base R

Consider this plot, which shows values ranging from 0.042 to 0.241: library(sf) demo(nc, ask=FALSE, echo=FALSE) brks <- seq(0, 0.2, by=0.05) plot(nc["AREA"], key.pos=1, breaks=brks, at=...
thiagoveloso's user avatar
  • 2,671
0 votes
1 answer
858 views

Add labels on top of plot of shapefiles

Consider an example dataset where I have four polygons: I want the colour of the polygon to be based on which group it is in, a legend showing what each colour means and a label over each polygon ...
Alan20's user avatar
  • 281
1 vote
2 answers
85 views

Plotting SpatialDesign object

I am working with the package 'spsurvey' and stumbled upon some difficulties in plotting the results. I want to plot the generated points in 'Equalsites' on the polygon 'UT_ecoregions'. However, it ...
adwiputra's user avatar
2 votes
1 answer
379 views

What is the easiest way to get the default R sf map plot default legend back?

I have been trying to display a legend on a choropleth plot but finding the R docuemntation for legend a bit difficult to get my head around. Been reading it for a few hours now. I see that the ...
paolov's user avatar
  • 2,257

15 30 50 per page