How do you change the size of figure drawn with matplotlib?
There is also this workaround in case you want to change the size without using the figure environment. So in case you are using plt.plot() for example, you can set a tuple with width and height.
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (20,3)
This is very useful when you plot inline (e.g. with IPython Notebook). As @asamaier noticed is preferable to not put this statement in the same cell of the imports statements.
The figsize
tuple accepts inches so if you want to set it in centimetres you have to divide them by 2.54 have a look to this question.