Legends are overlapping with axis

Hello,

My legends overlap into my axis.
I have tried changing the fig size, moving the location of the legend, moving the order of my code (moving tight_layout above other lines of code), I have tried to change the space between the subplots and nothing seems to work.
I have noticed that in some cases when I change the legend location or change the fig size, nothing changes.

Below is the code

color_index = 0
cols = goal_cols
colors = goal_colors
title = goal_title

# define subplot grid
fig, axs = plt.subplots(nrows=9, ncols=2,figsize=(25, 36), sharex = False, sharey=False)
fig.tight_layout() 
fig.set_tight_layout(True)
fig.subplots_adjust(top=0.3, hspace=.75, wspace=.5)
fig.suptitle(title + " Monthly Trending", fontsize=24,  y=0.995)
rcParams['axes.titlepad'] = 10

for c, ax in zip(cols, axs.ravel()):
    c_renamed = c.replace('_', ' ')
    c_renamed = c_renamed.title()
    sns.lineplot(data = data, x = 'year_month', y = c, linewidth = 2, estimator = 'mean', marker = 'o', markersize = 8, 
                 color=colors[color_index], linestyle = '-', legend = True, ax = ax, label = c_renamed)
    ax.set_title(f'{c_renamed} by Month', loc='center', fontsize=13, fontweight=0, color='black')
    ax.set_ylabel(f'{c_renamed}', fontsize=13)
    ax.set_xlabel(None)
    ax.tick_params(axis='x', labelsize=12, rotation=30)
    ax.tick_params(axis='y', labelsize=12)
    ax.yaxis.set_major_formatter(ticker.StrMethodFormatter('{x:,.1f}'))
    ax.xaxis.set_major_locator(ticker.MultipleLocator(2))
    ax.axhline(data[c].median(), color = "#d7d8d9", linestyle='--', label = "median")
    ax.annotate('median = ' + str(format(data[c].median(), ',.2f')), xy = (ax.get_xlim()[0]+0.2, data[c].median()), ha = "left", va="bottom", color = "#404141", fontsize=12)
    ax.legend(loc='lower center', bbox_to_anchor=(0.5, -0.25), ncol=2, fontsize=12)
    color_index += 1
    ymin, ymax = ax.get_ylim()
    ax.set_ylim(0, 1.3 * ymax)

Thanks!

We can’t really help without something that is minimal and reproducible. I’m also not sure what sns.lineplot does, so perhaps worth asking in a seaborn oriented forum.