Setting different color for each series in scatter plot on matplotlib

I don’t know what you mean by ‘manually’. You can choose a colourmap and make a colour array easily enough: import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm x = np.arange(10) ys = [i+x+(i*x)**2 for i in range(10)] colors = cm.rainbow(np.linspace(0, 1, len(ys))) for y, c in zip(ys, colors): plt.scatter(x, y, … Read more

Make contour of scatter

You can use tricontourf as suggested in case b. of this other answer: import matplotlib.tri as tri import matplotlib.pyplot as plt plt.tricontour(x, y, z, 15, linewidths=0.5, colors=”k”) plt.tricontourf(x, y, z, 15) Old reply: Use the following function to convert to the format required by contourf: from numpy import linspace, meshgrid from matplotlib.mlab import griddata def … Read more