Save plot to image file instead of displaying it using Matplotlib

While the question has been answered, I’d like to add some useful tips when using matplotlib.pyplot.savefig. The file format can be specified by the extension: Will give a rasterized or vectorized output respectively, both which could be useful. In addition, there’s often an undesirable, whitespace around the image, which can be removed with: Note that … Read more

What is the difference between importing matplotlib and matplotlib.pyplot?

I don’t know of any way to import all the functions from every submodule. Importing all the functions from a submodule is possible the way you suggested with e.g. from matplotlib.pyplot import *. Be noted of a potential problem with importing every function; you may override imported functions by defining your own functions with the same … Read more