Skip to content

Instantly share code, notes, and snippets.

@MilesCranmer
Created January 28, 2020 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MilesCranmer/5c0913222a84fcc006335ff5f92b3648 to your computer and use it in GitHub Desktop.
Save MilesCranmer/5c0913222a84fcc006335ff5f92b3648 to your computer and use it in GitHub Desktop.
Pretty plots taken from Neural Tangents notebook
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('pdf', 'svg')
import matplotlib
import seaborn as sns
sns.set(font_scale=1.3)
sns.set_style("darkgrid", {"axes.facecolor": ".95"})
import matplotlib.pyplot as plt
def format_plot(x=None, y=None):
# plt.grid(False)
ax = plt.gca()
if x is not None:
plt.xlabel(x, fontsize=20)
if y is not None:
plt.ylabel(y, fontsize=20)
def finalize_plot(shape=(1, 1)):
plt.gcf().set_size_inches(
shape[0] * 1.5 * plt.gcf().get_size_inches()[1],
shape[1] * 1.5 * plt.gcf().get_size_inches()[1])
plt.tight_layout()
legend = functools.partial(plt.legend, fontsize=10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment