Hard to tell without having your data...
But that is too easy answer to give, so in principle:
- for colors consider adjusting the
scale_fill_* part of your ggplot call
- for zoom consider adjusting the
coords_sf() part of your ggplot call; note that you can set both X and Y limits separately, with interesting interpretation of the special value of NA as "leave it as it stands"
So consider this piece of code as a baseline - it draws a dull default:
library(sf)
library(ggplot2)
shape <- st_read(system.file("shape/nc.shp", package="sf")) # included with sf package
# default zoom, default colors
ggplot(data = shape,
aes(fill = BIR74)) +
geom_sf()
And now consider this, slightly adjusted, piece of code:
# zoom + colours from https://www.imdb.com/title/tt0362270/ - just for the heck of it...
ggplot(data = shape,
aes(fill = BIR74)) +
geom_sf() +
scale_fill_gradientn(colours = wesanderson::wes_palette("Zissou1", 100, type = "continuous")) +
coord_sf(xlim = c(-90, NA),
ylim = c(NA, 40))
What it does differently is:
- it sets fill colors to a Wes Anderson palette - Zissou's Life Aquatic, because why not?
- it zooms the map out by extending the X coordinate westward to -90° and Y coordinate northward to 40°, leaving the east and south margins unchanged (again, for no particular reason other than just showing off...)