I'm struggling to plot my data on separate graphs (one graph, 1 line) and give them an appropriate "name" as a label.
import matplotlib.pyplot as plt
d = pd.DataFrame({'Time_min': [1, 2, 3],
'A1': [1000, 2000, 1000],
'A12': [2000, 3000, 2000],
'B12': [3000, 5000, 3000]})
template = pd.DataFrame({'well_id': ['A1', 'A12', 'B12'],
'name': ['Sample1', 'Sample2', 'Sample4']})
df1 = pd.merge(template, d.T, how='left', left_on='well_id', right_index=True)
df2 = df1.iloc[:,2:].T
print(d.head())
print(df1.head())
#for index, row in df2.iterrows():
plt.figure()
plt.plot(d.Time_min, df2, label = df1.iloc[:,1])
plt.legend()
plt.show()
In the end I want each of my graphs to look like this:
plt.plot(d.Time_min, d['A12'], label = df1.iloc[1,1])
But without specifying exact sample and it's label (name) visualized on the graph.

