Skip to content

Instantly share code, notes, and snippets.

@binste
Last active August 4, 2019 06:30
Show Gist options
  • Save binste/92ff07e62fd4b67252243ed218fa3dd1 to your computer and use it in GitHub Desktop.
Save binste/92ff07e62fd4b67252243ed218fa3dd1 to your computer and use it in GitHub Desktop.
Better plot defaults for matplotlib
import matplotlib.pyplot as plt
font_size = 18
plt.style.use("seaborn-whitegrid")
plt.rc("axes.spines", top=False, right=False, bottom=False, left=False)
plt.rcParams["figure.figsize"] = (10, 6)
plt.rcParams["font.size"] = font_size
plt.rcParams["axes.labelsize"] = font_size
plt.rcParams["xtick.labelsize"] = font_size
plt.rcParams["ytick.labelsize"] = font_size
plt.rcParams["legend.fontsize"] = font_size
plt.rcParams["figure.titlesize"] = font_size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment