Adding a colormap to a figure without imshow/countour set

Posted on 25 March 2015 in matplotlib • Tagged with python, matplotlib

Example: plot a packing using circles, and use the foreground color to show some value for each particle, for example the contact number Z:

The trick to this is to call plt.scatter() to plot a single point outside the axis range. This allows plt.colorbar() to find cmap and …


Continue reading