bbox_to_anchor and loc in matplotlib

When bbox_to_anchor and loc are used together, the loc argument will inform matplotlib which part of the bounding box of the legend should be placed at the arguments of bbox_to_anchor. For example (I’ve simplified the command a bit), the three options below will produce different locations for your legend, The first command will put the … Read more

Scatter plot colorbar – Matplotlib

You’re passing in specific rgb values, so matplotlib can’t construct a colormap, because it doesn’t know how it relates to your original data. Instead of mapping the values to RGB colors, let scatter handle that for you. Instead of: Do: (Just pass in to c what you were originally passing into plt.cm.jet.) Then you’ll be … Read more

matplotlib does not show my drawings although I call pyplot.show()

If I set my backend to template in ~/.matplotlib/matplotlibrc, then I can reproduce your symptoms: ~/.matplotlib/matplotlibrc: Note that the file matplotlibrc may not be in directory ~/.matplotlib/. In this case, the following code shows where it is: If you edit ~/.matplotlib/matplotlibrc and change the backend to something like GtkAgg, you should see a plot. You … Read more