I am new to Matplotlib. How do I prevent my graph from backtracking? Note the hook in the upper right of my graph. The X axis are strings, the Y axis are floats.
Here is my data:
['192.168.0.1', 2.568]
['96.120.96.153', 14.139]
['96.110.232.169', 10.505]
['162.151.49.133', 11.446]
['68.86.90.225', 24.335]
['68.86.84.226', 23.631]
['68.86.83.94', 29.011]
['173.167.58.162', 35.688]
['209.58.57.17', 162.768]
['64.86.79.2', 187.42]
['64.86.21.104', 162.461]
['63.243.205.1', 166.525]
['120.29.217.66', 156.898]
['209.58.86.143', 156.785]
['120.29.217.66', 181.599]
And the corresponding code:
import matplotlib.pyplot as plt
# x axis values
a = []
# corresponding y axis values
b = []
for k in range(15):
a.append(dataArray[k][0])
b.append(dataArray[k][1])
# plotting the points
plt.plot(a, b)
# naming the x axis
plt.xlabel('Hop Addresses')
# naming the y axis
plt.ylabel('average time (ms)')
# giving a title to my graph
plt.title('Time vs. Hops')
# function to show the plot
plt.show()