我正在做一些迷你項目。我有 x,y 數組,并希望將所有 xy 對與與其權重相對應的數字連接起來(如熱圖或某事)。位置列表是 X,y 對,而權重列表是數字列表。我的代碼如下所示:def plot_data(layer_num):
t = list_of_postitions[layer_num]
c = list_of_weights[layer_num]
# we create matrix of x,y positions of spots
r = np.reshape(t,(-1,2)) print(np.shape(r))
x, y = r.T
plt.scatter(x,y)
plt.title('Layer {}'.format(layer_num))
plt.xlabel("X position")
plt.ylabel("Y position")
plt.show()謝謝您的幫助
添加回答
舉報
0/150
提交
取消