I am trying to plot two columns from two different dataframes in one graph. I have figured out the code to plot it in one but the x axis needs to be in ascending order. Can we do that in this case?
df1=pd.DataFrame({ 'ID': ['A1','A2','A6','A7','A9'], 'F1_S': [23,75,42,77,54] },
columns=['ID', 'F1_S'])
df2=pd.DataFrame({ 'ID': ['A3','A4','A5','A8'], 'F1_S': [66,43,56,86] },
columns=['ID', 'F1_S'])
x1 = list(df1['ID'])
y1= list(df1['F1_S'])
lists1 = sorted(zip(*[x, y1]))
x1, y1 = zip(*sorted(zip(x1, y1)))
x2 = list(df2['ID'])
y2= list(df2['F1_S'])
lists2 = sorted(zip(*[x2, y2]))
x2, y2 = zip(*sorted(zip(x2, y2)))
plt.plot (x1,y1)
plt.plot(x2,y2)

