Skip to content

Instantly share code, notes, and snippets.

@mesquita
Created December 30, 2021 19:13
Show Gist options
  • Save mesquita/1837ea4b770253ab76c0e0b65244caf3 to your computer and use it in GitHub Desktop.
Save mesquita/1837ea4b770253ab76c0e0b65244caf3 to your computer and use it in GitHub Desktop.
Set plot properties
def set_plot_props(font_size: int = 14):
"""This function sets some plot configurations for the matplotlib."""
plt.rcParams["axes.prop_cycle"] = cycler("color", plt.get_cmap("tab10").colors)
plt.rcParams["figure.dpi"] = 150
plt.rcParams["savefig.dpi"] = 300
plt.rcParams["lines.linewidth"] = 2.5
plt.rcParams["font.size"] = font_size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment