Created
May 19, 2020 08:11
-
-
Save casarock/67df96c498c1fd444eae67161bfec114 to your computer and use it in GitHub Desktop.
plotting the diagram
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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