You can tweak the colors as you need:
gdat <- interp2xyz(fld, data.frame=TRUE)
ggplot(gdat) +
aes(x = x, y = y, z = z, fill = z) +
geom_tile() +
coord_equal() +
geom_contour(color = "white", alpha = 0.5) +
scale_fill_distiller(palette="Spectral", na.value="white") +
theme_bw()
You can reduce the pixelation at the cost of some processing time by increasing the density of the interpolation:
fld <- with(df, interp(x = longitude,
y = latitude,
z = d13C,
xo = seq(min(longitude), max(longitude), length=400),
duplicate="mean"))
and also reducing the bin width:
ggplot(gdat) +
aes(x = x, y = y, z = z) +
geom_tile(aes(fill=z)) +
coord_equal() +
stat_contour(aes(fill=..level..), geom="polygon", binwidth=0.005) +
geom_contour(color="white", alpha=0.5) +
scale_fill_distiller(palette="Spectral", na.value="white") +
theme_bw()
NOTE: that is going to crunch for a noticeable few seconds on a decent desktop system. On my fairly beefy MacBook Pro it was:
user system elapsed
6.931 0.655 8.153
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…