Skip to content

Instantly share code, notes, and snippets.

@sengstacken
Last active November 15, 2016 20:57
Show Gist options
  • Save sengstacken/fcc566d5e67c82fbf4bfa187955c97d1 to your computer and use it in GitHub Desktop.
Save sengstacken/fcc566d5e67c82fbf4bfa187955c97d1 to your computer and use it in GitHub Desktop.
# import numpy and set the printed precision to something humans can read
import numpy as np
np.set_printoptions(precision=2, suppress=True)
# set some prefs for matplotlib
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams.update({'text.usetex': True})
fig_width_pt = 700.  # Get this from LaTeX using \showthe\columnwidth
inches_per_pt = 1.0/72.27               # Convert pt to inches
fig_width = fig_width_pt*inches_per_pt  # width in inches
FORMATS = ['pdf', 'eps']
phi = .5*np.sqrt(5) + .5 # useful ratio for figures
# define plots to be inserted interactively
%matplotlib inline
#%config InlineBackend.figure_format='retina' # high-def PNGs, quite bad when using file versioning
%config InlineBackend.figure_format='svg'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment