Comparing scatterplots with lots of points I have two sets of data of protein-protein interactions in a matrices entitled: s1m and s2m. Each DB and AD pair make an interaction and the one matrix looks like:
> head(s1m)
     DB_num AD_num
[1,]      2   8153
[2,]      7   3553
[3,]      8   4812
[4,]     13   7838
[5,]     24   3315
[6,]     24   6012

I can then plot the density of the points basically showing where the points are the most concentrated:
s1m:

s2m:

The code I used in R to make these plots was:
z <- kde2d(s1m[,1], s1m[,2], n=50)
filled.contour(z)
z <- kde2d(s2m[,1], s2m[,2], n=50)
filled.contour(z)

I want to be able to somehow compare how simiarly these plots are rather than just looking at them by eye. Is there someway to do this? By the way, I know very little about statistics. These are very large datasets also, something like 10,000 points among a matrix of 15k by 15k.
 A: You could look at the distribution of the differences between the z values returned by kde2d (i.e., z$z).
Let's create some example data:
set.seed(42)

x <- 1:100
y <- 1:100


Z1 <- outer(x, y, function(a,b) rnorm(length(a)))
Z2 <- outer(x, y, function(a,b) rnorm(length(a)))

filled.contour(Z1-Z2)


summary(as.vector(Z1-Z2))
#   Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
#-6.844000 -0.973200 -0.003553 -0.012130  0.942800  5.598000 
sd(Z1-Z2)
#[1] 1.429194

Z3 <- outer(x, y, function(a,b) a+b-mean(a+b)+rnorm(length(a)))

filled.contour(Z1-Z3)


summary(as.vector(Z1-Z3))
#    Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
#-99.49000 -29.37000   0.08199  -0.01940  29.46000 101.00000 

sd(Z1-Z3)
#[1] 40.83703

A: What about something like this (using the "geyser" data set for illustrative purposes)
From the example:
attach(geyser)
f1 <- kde2d(duration, waiting, n = 50, 
            lims = c(0.5, 6, 40, 100))

Make up new data:
geyser2 <- geyser*rnorm(1)
f2 <- with(geyser2, kde2d(duration, waiting, n = 50,
            lims = c(0.5, 6, 40, 100)))

Create differences and plot them:
zdiff <- f1$z - f2$z
contour(zdiff)

A: You could compare contour line plots directly on the same graph. 
 library(ggplot2)
   ggplot(mpg, aes(x = displ, y = cyl)) + stat_density2d () + 
   stat_density_2d(mapping = aes(x = mpg$displ[sample(1:length(mpg$displ))], y = mpg$cyl),
     color = "green", geom = "density_2d", position = "identity" , contour = TRUE, n = 100,
     h = NULL, na.rm = FALSE, show.legend = F, inherit.aes = F)


Unfortunately the contours are hard to see though the obvious linear relationship is not. Also using few data points means every permutation changes the plot. Maybe we need something like probability distribution of each 2d bin.
If you just want a test instead here is the question: goodness of fit for 2d histograms.
