I am working on some mini project. I have array of x,y and want to connect all xy pairs with a number corresponding it's weight (like a heat map or sth). List of position is X,y pairs while the list of weights is list of numbers. My code look like this:
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()
Thank you for your help