Skip to content

Commit

Permalink
remove box legend; shift down
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleclo committed Dec 18, 2024
1 parent 6e00d89 commit 09730d4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions scripts/flops_by_perf_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
# 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)
Expand Down Expand Up @@ -226,7 +223,6 @@ def format_scientific(x):
# Customize the plot
plt.xlabel("Approximate FLOPs", fontsize=12)
plt.ylabel(f"Avg Performance ({num_datasets} Benchmarks)", fontsize=12)
# plt.title("FLOPs vs Performance", fontsize=14, pad=20)

# Add grid
plt.grid(True, which="both", ls="-", alpha=0.2)
Expand All @@ -241,14 +237,15 @@ def format_scientific(x):
plt.legend(
ordered_handles,
desired_order,
bbox_to_anchor=(0, 1.02, 1.0, 0.2),
bbox_to_anchor=(0, 0.97, 1.0, 0.2),
loc="center",
ncol=len(categories),
mode="expand",
borderaxespad=0.0,
fontsize=8,
handletextpad=0.05, # Reduce space between marker and label
columnspacing=0.5, # Adjust space between columns
frameon=False, # Remove the legend border
)

# Adjust the layout to prevent legend cutoff
Expand Down

0 comments on commit 09730d4

Please sign in to comment.