diff --git a/scripts/flops_by_perf_figure.py b/scripts/flops_by_perf_figure.py index 3f050a82a..4bf88f88d 100644 --- a/scripts/flops_by_perf_figure.py +++ b/scripts/flops_by_perf_figure.py @@ -31,7 +31,37 @@ """ +# First clear any existing font cache +import shutil + +import matplotlib as mpl +import matplotlib.font_manager as fm import matplotlib.pyplot as plt +from matplotlib.font_manager import FontProperties + +# Find path to Manrope font on your computer +# fonts = [f for f in fm.findSystemFonts()] +# manrope_fonts = [f for f in fonts if "manrope" in f.lower()] +# for font in manrope_fonts: +# print(font) + + +cache_dir = mpl.get_cachedir() +shutil.rmtree(cache_dir) + +# Load the font file +font_path = "/Users/kylel/Library/Fonts/Manrope-VariableFont_wght.ttf" +font_prop = FontProperties(fname=font_path) + + +# Try setting weight after creation +font_prop.set_weight(500) + + +# Set it globally using the font property +plt.rcParams["font.family"] = "sans-serif" +plt.rcParams["font.sans-serif"] = [font_prop.get_name()] + import numpy as np import pandas as pd