I have plots, containing technical measurements which are looking like this:
Now I want to remove everything but the content and I managed to get to this point you can see in the following image. But I'm still having the borders on the right and left side. (I changed the background color to yellow for better visibility and highlighted the borders I want to get rid of with red. Actually, they are white).
How can I remove them (the bottom and top don't need to be removed), so that the plot begins exactly where the line starts/ends?
Target image should still be 480x480px, even without the borders.
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
df = pd.DataFrame({"x":[1,2,3,4,5,6,7,8,9,10],
"y1":[4,3,2,6,6,2,1,5,7,3],
"y2":[1,0,6,0,9,2,3,5,4,7]})
size=[480,480]
fig, ax = plt.subplots(figsize=(size[0]/100, size[1]/100), dpi=100, facecolor="yellow")
p2 = sns.lineplot(data=df, x="x", y="y1", ax=ax)
p2.set(xlabel=None, xticklabels=[],
ylabel=None, yticklabels=[])
p3 = sns.lineplot(data=df, x="x", y="y2", ax=ax)
p3.set(xlabel=None, xticklabels=[],
ylabel=None, yticklabels=[])
ax.set(ylim=(0, 10))
plt.box(False)
plt.tick_params(left=False, labelleft=False, bottom=False)
plt.tight_layout()
plt.show()