Questions tagged [geom-sf]
17 questions
2
votes
1 answer
Polygon edges and sides distorted in rayshader render
I've been trying to plot a 3D plot of some spatial polygons, but I cannot render the sides and edges of the polygons properly. Below is the code I used to produce the plot below.
# Produce the 2D plot first.
ggplot() +
geom_sf(data = strips,…

KO 88
- 55
- 5
1
vote
1 answer
How to completely get rid of borders in geom_sf
How can I completely get rid of borders using geom_sf? (The grids were created with st_make_grid.) I have tried color=NA and size=0, but neither do what I want.
ggplot() +
geom_sf(data = plot_data, aes(fill = as.vector(dist)), color=NA, size=0)…

bill999
- 2,147
- 8
- 51
- 103
0
votes
1 answer
Add custom legend in ggplot map
I face difficulties to add a custom legend on the Sardinia Island map below. This legend should include both color lines (NUTS2 and NUTS3 borders) and color points which represent the initiation points from where I performed atmospehir…

abibard
- 23
- 5
0
votes
1 answer
How to use fill aesthetic in geom_sf only for filtered values while ‘excluded’ and ‘NA’ values both presented on map with other colours
I want to use Spectral palette from RColorBrewer only for AREA greater than 0.1, but I also wanted to show AREA less than 0.1 with let’s say dark grey or even better with hatched. In addition to this, I want to render NA as light grey. So basically,…

rez
- 290
- 2
- 12
0
votes
0 answers
geom_sf in black and white?
I'm trying to produce a figure in black and white with geom_sf. I have seven categories so I want to make some of them patterned (rather than just shades of grey). But I can't seem to get geom_sf into black and white mode even to begin with. Any…

Rnewbie
- 51
- 4
0
votes
0 answers
How to avoid empty spots with geom_sf?
I have a sf dataframe called polyg_sf that I'd like to plot with geom_sf.
On every line there is the test value at location and the layer corresponds to identical locations (a square on my map at resolution 0.05).
Here's how the head of the…

JulietteTC
- 11
- 2
0
votes
1 answer
ggplot spatial data and ggsave unique id's in a for loop
I have a dataset with watersheds across 3 provinces. Each watershed has a corresponding shapefile, and score from 0 to 1 for ecosystem disruption under 3 rcp (climate projection models).
Here is the head of my dataframe:
ws rcp ecodisrup…

Megan S
- 3
- 2
0
votes
0 answers
How can I change the time between frames? in a gganimate plot map
I want to do a animate plot where the color of each region of Spain change each month. I am using the transition_manual but there is no posibility of arraging the time between frames. The plot is:
ggplot(df_g_m) +
geom_sf(aes(fill =…

Macadamia Brazowy
- 21
- 3
0
votes
1 answer
show NA values in geom_sf() , group_by
I am trying to report how often a district is showing up in my bride price sample. But I think when a district does't have any reports or NAs, then the frequency == 0 so the district is still being coloured. I want to show districts with NAs as grey…

user
- 23
- 2
0
votes
0 answers
Select adequate x-axis limits to center an SF object plotted with ggplot and geom_sf
I have a map of the US county boundaries. The small section of Alaska that falls in the Eastern Hemisphere is showed at the right of the map, distorting the plot. I would like to explore options to re-center the map without losing that section.
I…
0
votes
0 answers
Problems combining geom_sf() and geom_point() in same plot: points do not appear
I have a set of points (ptns) identified by latitude and longitude that I wish to plot on a map of the US-county-boundaries. I'm using the tidycensus::county_laea, an "sf" object. Only one point appears on the map and regardless of the coordinates I…
0
votes
1 answer
How to Layer two geom_sf layers in ggplot with two different scale_fill_gradientn?
I have a dataset that looks like the following:
library(tidyverse)
library(sf)
library(giscoR)
temp <- data.frame(Country = c("United States", "Brazil", "Mexico", "Canada", "Argentina", "Chile",
"Peru", "Guatemala",…

Jacob
- 406
- 3
- 19
0
votes
1 answer
Tell shiny I am talking about a data frame column name not a variable
So I am trying to create a shiny app in which I am plotting a map of India using sf data.
I have uploaded a dataset which has multiple columns.
So I ask the use to select the column. But when I gave that input to geom_sf(fill = input$select_topic)…

Rick Bukhariya
- 3
- 3
0
votes
0 answers
Reprojecting longitude and latitude coords within a dataframe to a mollweide projection for Ratite biogeographical distribution
I'm struggling to find a way to reproject the co-ordinates of my dataframe so I can plot them into a different projection. When I do all points collapse towards 0,0. so I take it the map itself is projecting towards my desired projection but the…

Aamir
- 1
- 2
0
votes
1 answer
Map layers do not align with each other in R
Recently, I have been asked to produce a map showing fault lines in Turkey after the unfortunate two earthquakes that took place today. Although I am not an expert in geospatial analysis, I have tried to produce this map with the following code…

mzkrc
- 219
- 2
- 7