两个散点图“匹配”有多好?

时间:2018-01-21 17:56:42

标签: python matplotlib plot scatter

我不确定“匹配”是否真的是正确的词,但我必须分散以下形式的图。

enter image description here enter image description here

我想比较两者,但我不确定如何做到这一点。当我说比较时,我的意思是我想知道这两个情节彼此“有多相似”。所以第一个问题是你可以用什么方法来实现这个目标,第二个问题我将如何实现这一点。

使用this代码的修改版本(没有关于强度的信息)生成图表。

那么python中有没有办法做类似的事情?

谢谢,Sito。

1 个答案:

答案 0 :(得分:1)

在评论中我声称两个地块之间的相似性为42.这就是为什么:

import numpy as np
import matplotlib.pyplot as plt
# read in the two images
a = plt.imread("data/sim1.png")
b = plt.imread("data/sim2.png")
# define a similarity measure, 
# here we take the sum of the squares of the distances between pixels
similarity = np.ceil(np.sum((a-b)**2)/1000.)
print(similarity)
# this prints 42.0