I have several Spatial Polygon Data Frames I am adding successively to a plot in R 4.0.2. The polygons represent US States, National Forests, National Parks, and wildfire perimeters. While it probably doesn't make sense to provide links to all the data for a fully reproduced working example, the following code is a simplified version of the plot I made:

# equal area projection
proj_coords <- "+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0"

# load libraries

# Make a bbox of the total extent
e <- as(raster::extent(-1400000,-850000,2300000,2750000), "SpatialPolygons")
proj4string(e) <- proj_coords

# Make a smaller box to add to the plot for Stack overflow example
e2 <- as(raster::extent(-1300000,-900000,2400000,2650000), "SpatialPolygons")
proj4string(e2) <- proj_coords

# Plot
lt.green <- adjustcolor("lightgreen", alpha.f = 0.5)

My question:

In my real plot, e2 are National Forest boundaries, some of which extend beyond the extent of the plot axes. When I try to add them to the plot with

lt.green <- adjustcolor("lightgreen", alpha.f = 0.5) 

all of the National Forest boundaries plot, but some of them are not filled with color. This is true both when I print the graphic in the console and when I try to export it as a png.

Below is the actual png. The polygons with empty, thin gray borders are the National Forests that are failing to fill with color, while the green ones are correctly filled.

enter image description here

  • GIS SE site has policy of focused questions, so please ask only one question per question. – TomazicM Jan 26 at 16:52
  • Should I delete it and repost it? – gcgaines Jan 26 at 18:40
  • No, just edit it and focus on one question only. – TomazicM Jan 26 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.