Change size of the image using .savefig with Python/Matplotlib

Hello, i would like to set width and height when I’m saving an image using savefig attribute in Pyplot. 
That is my code:
As you can see, I tried to add figsize, but it output me these errors: “‘Figure’ object is not callable”, Line2D’ object has no property figsize.
Webdiretto reply:
1. import from matplotlib
from matplotlib import *
import sys
from pylab import *
2.  Use set_size_inches
3. Add dpi attribute to increase resolution:
a.figure.savefig(“test.png”, dpi=199)