So, I know similar questions have been posted, but nothing has worked for my particular case yet. I know it can be done with the Pandas plot function, but these lines need to be on a Matplotlib figure so they can be plotted with scatters and other things...
I have a DataFrame like this:
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
lines = pd.DataFrame(columns=list('ABC'))
lines.columns = ['T', 'Line1', 'Line2']
lines['T'] = np.arange(0,100,0.1)
lines['Line1'] = np.cos(lines['T']) + 30
lines['Line2'] = np.sin(lines['T']) + 13
And I want to make a plot with 2 separate lines that share the same X axis. I can do it like this:
plt.figure()
plt.plot(lines['T'], lines['Line1'])
plt.plot(lines['T'], lines['Line2'])
plt.show()
But, I'd like to do it via loop. Sorry if this has been answered somewhere else, but I couldn't find it. Any help would be appreciated! Thanks.

lines.plot(x='T')?