I'm plotting a list of tuples, which contains the x and y coordinates of each point.
The problem is : I am able to plot the points individually or connect them sequentially. However, I can't really find a way to let each data point connect to adjacent points. In other words, I want to make a net-like figure with each data point being a node.
Accurately speaking, I wanted to plot dots that connect to other adjacent dots.
I'm not really sure what to add or edit this piece of code.
points = [] # A container to place my coordinates
"""
self.net is a 10*10*2 ndarray that describes the x and y values of
each weight. There is a total of 100 weights.
(I'm doing a SOM by the way)
"""
for m in range(self.network_dimensions[0]):
for n in range(self.network_dimensions[1]):
points.append((self.net[m][n][0], self.net[m][n][1]))
plt.plot(*zip(*points), 'bo-')
plt.show()
# This plot is shown as Result_2
# If I plot each point individually, I get Result_1
Here are some current results:
Result_1: https://i.stack.imgur.com/VaGs2.jpg
Result_2: https://i.stack.imgur.com/JhO0i.jpg