I have a dataset where i am plotting certain values using a line plot
the points are denoted by circular markers
what i want to do is – have colours of the markers correspond to the nature of the points green for (y>=0) and red for (y<0)
is there an way i can achieve this in a line plot ? is there any other type of plot i could use in matplotlib to achieve it ?
a = [1,2,3,4,5]
b = [1,5,-1,-2,0]
fig = plt.figure()
ax = fig.add_axes([0,0,3,3])
ax.plot(a, b, marker='o', mfc=['green','green','red','red','green'])
plt.show()
this is what i want to do