Reputation: 4148
I am plotting the below data frame using google charts.
Hour S1 S2 S3
1 174 0 811
2 166 0 221
3 213 1 1061
But with google charts, I am not able to save it to a file. Just wondering whether I can plot the dataframe in matplotlib line charts.
Any help would be appreciated.
Upvotes: 1
Views: 112
Reputation: 87376
matplotlib 1.5 and above supports a data
wkarg
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.plot('S1', 'S2', data=df)
or just directly pass in the columns as input
ax.plot(df['S1'])
Upvotes: 1
Reputation: 17122
pandas has charting method, just do:
df.plot()
where df is your pandas dataframe
Upvotes: 1