swcarpentry / python-novice-gapminder

Plotting and Programming in Python
http://swcarpentry.github.io/python-novice-gapminder/
Other
163 stars 428 forks source link

Change order of line 327 and 328 - Lesson Contribution #604

Closed Talishask closed 1 year ago

Talishask commented 2 years ago

I'm a member of The Carpentries Core Team and I'm submitting this issue on behalf of another member of the community. In most cases, I won't be able to follow up or provide more details other than what I'm providing below.


Swap the order of lines 327 (fig = plt.gcf() # get current figure) and 328 (data.plot(kind='bar'). This will then correctly save the bar plot as the last global plot. Currently, this code does not save and generates an empty plot file.