Skip to content

Instantly share code, notes, and snippets.

@hancush
Last active January 26, 2018 20:09
Show Gist options
  • Save hancush/dcba06d6d93a4898b4169dfca1720913 to your computer and use it in GitHub Desktop.
Save hancush/dcba06d6d93a4898b4169dfca1720913 to your computer and use it in GitHub Desktop.
# header
here's what this is
<<>>=
import pandas as pd
@
<<>>=
data = pd.read_csv('path/to/your/data') # returns a dataframe
# grab the ax obj
ax = data[['year', 'number_of_sessions']].plot(x='year')
# get a handle on the figure via the ax
figure = ax.get_figure()
# save the figure
figure.savefig('path/to/saved/image')
@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment