Skip to content

Instantly share code, notes, and snippets.

@casarock
Created May 19, 2020 08:11
Show Gist options
  • Save casarock/67df96c498c1fd444eae67161bfec114 to your computer and use it in GitHub Desktop.
Save casarock/67df96c498c1fd444eae67161bfec114 to your computer and use it in GitHub Desktop.
plotting the diagram
def plot_diagram(self,
yvalue,
xlabel,
ylabel,
title,
filename):
plt.figure(figsize=(8,5))
ax = plt.gca()
self.overall.plot(kind='line',
y=yvalue,
ax=ax,
label="Overall",
color='black')
self.germany.plot(kind='line',
y=yvalue,
ax=ax,
label="Germany",
color='red')
plt.xlabel(xlabel)
plt.ylabel(ylabel)
plt.title(title)
plt.savefig(filename + '.png', dpi=300)
return filename + '.png'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment