 <p>you just want a scatter plot of points with x and y coordinates and a colour representing a third variable?</p> <p>this is what scatter is for, just use:</p> <pre><code>import matplotlib.pyplot as plt plt.scatter(x, y, c=z, cmap='jet') </code></pre> <p>you can give it any other colormap, all possibilities are shown here: <a href="http://matplotlib.org/examples/color/colormaps_reference.html" rel="nofollow">http://matplotlib.org/examples/color/colormaps_reference.html</a></p> <p>here a small example:</p> <pre><code>import matplotlib.pyplot as plt import numpy as np x = numpy.random.normal(0, 2, 100) y = numpy.random.normal(0, 2, 100) r = np.sqrt(x**2 + y**2) plt.scatter(x, y, c=r, cmap='jet') </code></pre> <p>this would give you 100 2d-gaussian distributed points with colors depending on the distance to (0,0)</p>