From: Benjamin R. <ben...@ou...> - 2012-02-28 22:04:16
|
On Tue, Feb 28, 2012 at 3:48 PM, Mario Fuest <mar...@ao...> wrote: > Hi there, > > Currently i use these commands to layout and save my figures: > > > figure > > ... > > gca.set_aspect('equal') > > gca.autoscale(tight=True) > > ... > > plt.savefig('fpp.png', bbox_inches='tight', pad_inches=0) > > I would like to set the width of this png file, how to do that? If > savefig() does not support setting the width, maybe I can set the width > of my xaxis? > > Thanks in advance, Keba > > The size of the PNG will be based on the size of your figure object. When you create your figure, you can pass a figsize kwarg which takes a tuple of width, height in inches (defaults to 8 x 6, I think). fig = plt.figure(figsize=(10.0, 6.0)) I hope that helps! Ben Root |