Question: Setting colours for data points in a random 2D scatter plot

I have a function f(X,Y) and I create a random sequence of input values for X and Y.

I now want to create a 2D scatter plot with X and Y on the axis, on the graph I want each point (X,Y) to be color coded according to the value of f(X,Y).  For example, 0<f<1 Red, 1<f<2 Blue, 2<f<3 Green.

Does anyone know how I could do this? 

Please Wait...