You can use geom_bin2d()
(with "identity" status) or just draw rectangles.
dat <- data.frame(x=c(0,0,10,10), y=c(0,10,0,10), freq=c(1,0,1,3)) ggplot(dat) + geom_bin2d(aes(xmin=x, ymin=y, xmax=x+10, ymax=y+10, fill=freq), stat="identity") ggplot(dat) + geom_rect(aes(xmin=x, ymin=y, xmax=x+10, ymax=y+10, fill=freq))
source share