I am trying to figure out if there is anything built into pyplot that will change the color of my line depending on whether or not the data is negative or positive. For exam
If you use a scatter plot you can give each point a different color:
x = range(1) x = range(10) y = [i - 5 for i in x] c = [i < 0 for i in y] plt.scatter(x, y, c=c, s=80)