@@ -144,7 +144,7 @@ We create a color mapping between country codes and colors for consistency
144
144
country_names = data['countrycode']
145
145
146
146
# Generate a colormap with the number of colors matching the number of countries
147
- colors = cm.Dark2 (np.linspace(0, 0.8 , len(country_names)))
147
+ colors = cm.tab20 (np.linspace(0, 0.95 , len(country_names)))
148
148
149
149
# Create a dictionary to map each country to its corresponding color
150
150
color_mapping = {country: color for country, color in zip(country_names, colors)}
@@ -232,7 +232,7 @@ def draw_interp_plots(series, ylabel, xlabel, color_mapping, code_to_name, lw, l
232
232
ax.set_yscale('log')
233
233
234
234
# Draw the legend outside the plot
235
- ax.legend(loc='lower center', ncol=5 , bbox_to_anchor=[0.5, -0.25])
235
+ ax.legend(loc='lower center', ncol=6 , bbox_to_anchor=[0.5, -0.25])
236
236
ax.set_ylabel(ylabel)
237
237
ax.set_xlabel(xlabel)
238
238
@@ -517,7 +517,7 @@ start_year, end_year = (1821, 1945)
517
517
ax = draw_interp_plots(gdp[cntry].loc[start_year:end_year],
518
518
'Real GDP in 2011 $\'s','Year',
519
519
color_mapping, code_to_name, 2, False, ax)
520
- plt.savefig("./_static/lecture_specific/long_run_growth/tooze_ch1_graph.png", dpi=100 )
520
+ plt.savefig("./_static/lecture_specific/long_run_growth/tooze_ch1_graph.png", dpi=300, bbox_inches='tight' )
521
521
plt.show()
522
522
```
523
523
0 commit comments