column1 column2 column3 column4
a 1990 25 A
b 1990 27 A
c 1990 24 A
a 1991 26 B
b 1990 20 B
c 1990 20 C
so subset where column1 == a should be like
column1 column2 column3 column4
a 1990 25 A
a 1991 26 B
a 1990 20 C
I wrote a code to generage multiple plots of subset of pandas data frame subset is the set of rows where the column1 value is same in element of list in sub
sub = ['a','b','c','d','e']
for i in sub:
df_s = df[df['column1']==i]
plt.figure(figsize=(5,5))
sns.lineplot(x='column2',y='column3', data=df_s, hue='column4',legend=False)
plt.title("Data of " + p)
plt.show
the plots are generated separately with my code. but I want to make it in one figure and only one legend.

plt.figure(figsize=(5,5))before the loop for, then all the lines will be on the same graph, but it will look a bit messy I think. Could you add some input data to see what it looks like