Skip to content

Instantly share code, notes, and snippets.

@masterdesky
Last active June 5, 2025 11:02
Show Gist options
  • Save masterdesky/8ab467fd19d2160eb73f25b1a8fb459d to your computer and use it in GitHub Desktop.
Save masterdesky/8ab467fd19d2160eb73f25b1a8fb459d to your computer and use it in GitHub Desktop.
Configuration for the visual style of my educational plots in Python
# Initialize seaborn with custom settings
import matplotlib.pyplot as plt
import seaborn as sns
# Facecolor values from S. Conradi @S_Conradi/@profConradi
custom_settings = {
'figure.facecolor': '#f4f0e8',
'axes.facecolor': '#f4f0e8',
'axes.edgecolor': '0.3',
'axes.linewidth' : '0.5',
'axes.grid': False,
'grid.color': '0.7',
'grid.linestyle': ':',
'grid.alpha': 0.6,
'xtick.bottom': True,
'xtick.top': True,
'ytick.left': True,
'ytick.right': True,
}
for t in ['xtick', 'ytick']:
custom_settings[f'{t}.direction'] = 'in'
custom_settings[f'{t}.color'] = '0.3'
for m in ['major', 'minor']:
custom_settings[f'{t}.{m}.width'] = 0.5
custom_settings[f'{t}.{m}.size'] = 6 if m == 'major' else 3
sns.set_theme(palette=sns.color_palette('deep', as_cmap=False),
rc=custom_settings)
plt.rcParams['text.usetex'] = False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment