Created
January 28, 2020 16:55
-
-
Save MilesCranmer/5c0913222a84fcc006335ff5f92b3648 to your computer and use it in GitHub Desktop.
Pretty plots taken from Neural Tangents notebook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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