Last active
September 7, 2023 08:59
-
-
Save paidi/ea669037b68fd8ad2da25086b3d9d296 to your computer and use it in GitHub Desktop.
Loading DM Sans in matplotib
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
import matplotlib.font_manager as fm | |
import matplotlib.pyplot as plt | |
# Fetch DM Sans font file from https://github.com/google/fonts/blob/main/ofl/dmsans/DMSans%5Bopsz%2Cwght%5D.ttf | |
font_dir = ['.'] | |
for font in fm.findSystemFonts(font_dir): | |
fm.fontManager.addfont(font) | |
# Set font family globally | |
plt.rcParams['font.family'] = 'DM Sans' | |
sns.set_theme(font_scale=1.5, style="whitegrid") | |
biomodal_palette = ["#9CDBD9", "#C0DF16","#003B49","#05868E", "#ABAD9A", "#F87C56","#00DAEF","#50B37B"] | |
sns.set_palette(biomodal_palette) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment