|
From: Goyo <goy...@gm...> - 2010-10-10 10:05:44
|
2010/10/10 Alessio Civ <via...@gm...>: > > > Please, can someone help me? I've been digging the documentation, but I > can't find a way to do this. ¿Didn't you get my message on oct-5? I didn't send it to the list by mistake: --%<---------------------------------------------------------------------------- Make your variables numpy arrays and slice them using values in z: x = np.array([1, 2, 3, 4]) y = np.array([2, 3, 4, 5]) z = np.array([0, 1, 0, 1]) x0 = x[z == 0] y0 = y[z == 1] x1 = x[z == 0] y1 = y[z == 1] plt.scatter(x0, y0, c='b') plt.scatter(x1, y1, c='r') --%<------------------------------------------------------------------------ See the attached example, you can run it as a script or import it as a module and use the function multi_scatter in your code. Goyo |