1

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.

2 Answers 2

1

pandas has charting method, just do:

df.plot()

where df is your pandas dataframe

Sign up to request clarification or add additional context in comments.

Comments

1

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'])

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.