|
27 | 27 | color_based_on = "NUTS_NAME"
|
28 | 28 | map_filename = "germany.svg"
|
29 | 29 | elif no_germany:
|
30 |
| - legend_location = (0.8, 0.25) |
| 30 | + legend_location = (0.8, 0.4) |
31 | 31 | color_based_on = "CNTR_CODE"
|
32 | 32 | map_filename = "restofeur.svg"
|
33 | 33 | else:
|
34 |
| - legend_location = (0.5, 0.7) |
| 34 | + legend_location = (0.8, 0.4) |
35 | 35 | color_based_on = "CNTR_CODE"
|
36 | 36 | map_filename = "europe.svg"
|
37 | 37 |
|
|
98 | 98 | # try and get location from the european city list
|
99 | 99 | geometry = eur_location[eur_location.NUTS_NAME == row.id_name].geometry
|
100 | 100 | if geometry.empty: # if not then check international cities list
|
101 |
| - geometry = int_location[int_location.name == row.id_name].geometry |
| 101 | + geometry = int_location[int_location.ls_name == row.id_name].geometry |
102 | 102 | if geometry.empty: # if still not found then raise error
|
103 | 103 | raise IndexError(
|
104 | 104 | "Could not place the following location on map: "+row.common_name)
|
|
125 | 125 | eur_country.CNTR_CODE)].to_crs("EPSG:3857")
|
126 | 126 |
|
127 | 127 | # plot countries map
|
128 |
| -fig, ax = plt.subplots(1, figsize=(10, 10), tight_layout=True) |
| 128 | +fig, ax = plt.subplots(1, tight_layout=True, |
| 129 | + figsize=((12, 12) if only_germany else (20, 20))) |
129 | 130 | ax = eur_country.plot(ax=ax, column=color_based_on,
|
130 | 131 | cmap='tab20', edgecolor='w')
|
131 | 132 | # plot the patches
|
|
0 commit comments