Вы также можете создать 2D гистограмму, например:
library(gplots)
# number of bins in both dimensions
resolution <- 50
# toy data (sorry about copying from jyjek)
df <- data.frame(x=sample(resolution,5000,replace = T),
y=sample(resolution,5000,replace = T))
# the shown example has "jet" palette
jet.colors <-
c("#00007F", "blue", "#007FFF", "cyan", "#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000")
# the example has no margins
par(mar=c(0,0,0,0))
# plot the histogram without axes
hist2d(df, nbins=resolution, xaxt="n", yaxt="n", col=jet.colors)