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
You can conditionally plot data in your axes object, using a where like syntax (if you're used to something like Pandas).
where
ax.plot(x[f(x)>=0], f(x)[f(x)>=0], 'g') ax.plot(x[f(x)<0], f(x)[f(x)<0], 'r')
Technically, it's splitting and plotting your data in two sets, but it's fairly compact and nice.