##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Lance Simms, Stanford University 2009
#This script uses the example from 
#http://www.scipy.org/Cookbook/Matplotlib/LaTeX_Examples
#to generate a plot that has the proper size

import pylab
fig_mult     = 1.25
fig_width_pt = 487.8225     # Get this from LaTeX using \showthe\columnwidth
fig_width_pt_half = fig_width_pt/2      # Half the width for minipage plot
inches_per_pt = 1.0/72.27               	# Convert pt to inch
golden_mean = (sqrt(5)-1.0)/2.0         	# Aesthetic ratio
fig_width = fig_mult*fig_width_pt*inches_per_pt # width in inches
fig_height = fig_width*golden_mean      	# height in inches
fig_size =  [fig_width,fig_height]

##Print some output for the plot dimensions
print 'Width of Plot: '+ str(fig_width)+' inches'
print 'Height of Plot: ' + str(fig_height) + 'inches'

params = {'backend': 'ps',
          'axes.labelsize': 12,
          'text.fontsize': 12,
          'xtick.labelsize': 10,
          'ytick.labelsize': 10,
          'text.usetex': True,
          'figure.figsize': fig_size}
pylab.rcParams.update(params)
