You have two options. savefig does have a dpi option that
> will essentially set the figure size for the saved file:
> play with dpi until you get a figure size you like.
> The other way to set the figure size is to specify it when
> you create the figure: figure(1,(10,8)) would create a
> fairly large figure. The figure (1 in this case) must not
> already exist or at least it can't be shown on your screen
> already. By that I mean if you have already called
> figure(1) previously in your code, you must close it before
> you try to call figure(1,(10,8)) or the figure size won't be
Just to elaborate a bit. The figure size in pixels is the figure size
in inches * the dpi. you can set the figure size in inches when you
fig = figure(figsize=(6,8)) # 6x8 inches
and when you save it set the dpi
and you will have a 1200x1600 pixel PNG file.