You need to set the limits of your scale bar to have certain colors and also define the mean value (the value in the middle) to be a same value for both plots.
rng = range(c((x), (y))) #a range to have the same min and max for both plots
ggplot(data = melt(x)) + geom_tile(aes(x=X1,y=X2,fill = value)) +
scale_fill_gradient2(low="blue", mid="cyan", high="purple", #colors in the scale
midpoint=mean(rng), #same midpoint for plots (mean of the range)
breaks=seq(-100,100,4), #breaks in the scale bar
limits=c(floor(rng[1]), ceiling(rng[2]))) #same limits for plots
ggplot(data = melt(y)) + geom_tile(aes(x=X1,y=X2,fill = value)) +
scale_fill_gradient2(low="blue", mid="cyan", high="purple",
midpoint=mean(rng),
breaks=seq(-100,100,4),
limits=c(floor(rng[1]), ceiling(rng[2])))
This is the output:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…