I have 10 devices connected by wires and I used matplotlib.plot to make a figure for this system where the status of these devices is 0. After running the code, a new_status of 4 levels comes out. Then I am trying to plot the system based on the new status. my problem that I can't figure out a way to change the colors of both heads and lines. As an example, the new status of device 1 is now 3 so the head's color of device 1 and the line's color, connecting it to device 6, should be red, while device 6 should still blue. I tried if loop but I couldn't figure it out.
x=(1,2,3,4,5,1,2,3,4,5)
y=(1,2,3,4,5,6,7,8,9,10)
status=[0,0,0,0,0,0,0,0,0,0]
new_status=[3,0,0,2,0,0,0,0,4,1]
ax = plt.subplot()
y16 = (y[0], y[5])
x16 = (x[0], x[5])
ax.plot(y16 ,x16, marker='o', color='blue')
y28 = (y[7], y[1])
x28 = (x[7], x[1])
ax.plot(y28, x28, marker='o', color='blue')
y37 = (y[2], y[6])
x37 = (x[2], x[6])
ax.plot(y37, x37, marker='o', color='blue')
y410 = (y[3], y[9])
x410 = (x[3], x[9])
ax.plot(y410, x410, marker='o', color='blue', )
y59 = (y[4], y[8])
x59 = (x[4], x[8])
ax.plot(y59, x59, marker='o', color='blue')
plt.show()
