I am trying to create a scatter graph of following data
dict_a["src_ip"] = This contains range of source IP all unique (192.168.x.x)
dict_a["src_port"] = This contains range of source port all unique (1..100)
dict_a["time"] = This contains range of epoch time
I want to plot a graph with X axis having time
, y axis having port
and then plot the src_ip dots on the graph which will show that particular IP came tried connecting on this port on this time
I used something like this
plt.scatter(x=pkt_data['time'], y=pkt_data['src_port'])
Not sure how can i plot graph for the required information
I tried adding new code as below
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.scatter(time, port, alpha=0.8, c=z, edgecolors='none', s=30, label=ip)
print(tuple(ip))
plt.title('Matplot scatter plot')
plt.legend(loc=5)
plt.show()
Only problem is with the legend now. the color marker is coming in single line for all the IP's. Can i get this for every diff ip. z
is just random number