How can I change my plot so that the y axis label is moved slightly to the left, so it does not overlap with y axis tick labels?
Here is the code I used to create my plot:
import matplotlib.pyplot as plt
import seaborn as sns
sns.lineplot(data=reefs, x='Step', y='total_mm_growth', hue='AgentID', palette= "colorblind")
plt.xlabel('Step')
plt.ylabel('Growth (mm)', rotation = 0)
plt.legend(title="Reef ID")
plt.title("Modeled Change In Reef Elevation Over 5 Years")
I tried using solutions with ax.yaxis.set_label_coords(-1, 0)
but I get the error 'tuple' object has no attribute 'yaxis'
. I'm new to python and have no idea what I'm doing.