8000 Fix formatting · 2cans/python-basics-exercises@e15d759 · GitHub
[go: up one dir, main page]

Skip to content

Commit e15d759

Browse files
committed
Fix formatting
1 parent eef9b78 commit e15d759

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ch16-scientific-computing-and-graphing/2-use-matplotlib-for-plotting-graphs.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 1.16.2 - Use matplotlib for Plotting Graphs
1+
# 16.3 - Use matplotlib for Plotting Graphs
22
# Solution to review exercise #2
33

44
# Graph pirates versus global warming
@@ -25,16 +25,15 @@
2525

2626
plt.plot(pirates, temperatures, "r-o")
2727

28-
# label graph
2928
plt.title("Global temperature as a function of pirate population")
3029
plt.xlabel("Total pirates")
3130
plt.ylabel("Average global temperature (Celsius)")
3231
plt.axis([-300, 48000, 14, 16])
3332

34-
# annotate points with years
33+
# Annotate the plotted points with years.
3534
for i in range(0, len(years)):
3635
plt.annotate(str(years[i]), xy=(pirates[i], temperatures[i]))
3736

38-
# save and display graph
37+
# Save and display graph.
3938
plt.savefig(os.path.join(path, "Output/pirates.png"))
4039
plt.show()

0 commit comments

Comments
 (0)
0