I have an interpolated dataset that I want to plot. When I plot it as geom_point, I see a lot of features that I am missing when I use geom_raster or geom_contour. Im guessing it got smoothed over? Is there a way I can plot this without losing the finer grain contours picked up in the geom_point? and the second figure looks terrible! is there a way to smooth this?
ggplot() + geom_raster(data = df,
aes(x=X, y = Y, fill=Z)) + scale_y_reverse() +
scale_fill_distiller(palette = "RdYlBu") +
theme_bw() + theme(panel.grid = element_blank()))
ggplot(data=df, aes(x = X, y = Y)) +
geom_point(aes(colour = Z)) + scale_y_reverse() +
scale_colour_gradientn(colours = rev(ODV_colours)) +
theme_bw() + theme(panel.grid = element_blank()))
It seems that you have a low resolution raster and you want to interpolate to make this less blocky. You could use
interpfor 2-D interpolation in this instance: