I have to plot a linear function and color it in a way that all negative values are red and the positive values are blue.
This is just an example of what I want to ask.
Generalizing, is it possible to color specific intervals of a function in a different color than that of the rest of the function, without having to do different plots?
hold on
and then a blue coloured plot for the positive values. – Adriaan