Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 53fc676

Browse files
authored
Update Chapter 1
1 parent 1a60a32 commit 53fc676

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Chapter 1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,25 @@ If you have another look at the script, under # Additional Customizations, you'l
9494

9595
Hint: Add plt.grid(True) after the plt.text() calls so that gridlines are drawn on the plot.
9696

97+
# Scatter plot
98+
plt.scatter(x = gdp_cap, y = life_exp, s = np.array(pop) * 2, c = col, alpha = 0.8)
9799

100+
# Previous customizations
101+
plt.xscale('log')
102+
plt.xlabel('GDP per Capita [in USD]')
103+
plt.ylabel('Life Expectancy [in years]')
104+
plt.title('World Development in 2007')
105+
plt.xticks([1000,10000,100000], ['1k','10k','100k'])
106+
107+
# Additional customizations
108+
plt.text(1550, 71, 'India')
109+
plt.text(5700, 80, 'China')
110+
111+
# Add grid() call
112+
plt.grid(True)
113+
114+
# Show the plot
115+
plt.show()
98116

99117

100118

0 commit comments

Comments
 (0)