Skip to content

Instantly share code, notes, and snippets.

@rg089
Last active January 11, 2023 14:06
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 rg089/26d06984604c92cf452e77ee345434ea to your computer and use it in GitHub Desktop.
Save rg089/26d06984604c92cf452e77ee345434ea to your computer and use it in GitHub Desktop.
Style for latex plots in matplotlib/seaborn. Adapted from: http://aeturrell.com/2018/01/31/publication-quality-plots-in-python/. Reference: https://matplotlib.org/stable/tutorials/introductory/customizing.html for the meaning of parameters.
# FONT
font.size: 10
font.family: STIXGeneral
# AXES
axes.titlesize: 11
axes.titlepad: 3.5
axes.titleweight: bold
axes.labelsize: 8
axes.labelweight: normal
axes.labelpad: 1.5
axes.labelcolor: black
axes.ymargin: 0
axes.xmargin: 0
axes.spines.right : False
axes.spines.top : False
axes.grid: False
axes.prop_cycle : (cycler('color', ['bc80bd' ,'fb8072', 'b3de69','fdb462','fccde5','8dd3c7','ffed6f','bebada','80b1d3', 'ccebc5', 'd9d9d9']))
axes.formatter.use_mathtext: True
axes.autolimit_mode: round_numbers
axes.formatter.limits: -4, 4
axes.edgecolor: black
axes.linewidth: 0.8
# XTICKS
xtick.color: 323034
xtick.labelsize: 8
xtick.major.size: 2
xtick.major.width: 0.75
xtick.major.pad: 2
xtick.direction: out
# YTICKS
ytick.color: 323034
ytick.labelsize: 8
ytick.major.size: 2
ytick.major.width: 0.75
ytick.major.pad: 2
ytick.direction: out
# GRID
grid.color: b1afb5
# LEGEND
legend.title_fontsize: 8
legend.frameon: True
legend.framealpha: 0.65
legend.fontsize: 8
legend.edgecolor: 0.9
legend.borderpad: 0.2
legend.columnspacing: 0.5
legend.labelspacing: 0.15
# FIGURE
figure.titlesize: 11
figure.dpi: 500
savefig.bbox: tight
savefig.dpi: 500
savefig.transparent: True
savefig.pad_inches: 0.01
# TEXT
text.color: 323034
mathtext.fontset: stix
text.usetex: False
# LINES
lines.markeredgecolor: black
lines.linewidth: 2
# PATCHES
patch.facecolor : bc80bd
patch.force_edgecolor : True
patch.linewidth: 0.8
# SCATTER
scatter.edgecolors: black
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment