I try to create a map in GeoPandas in Python.
And I use below code:
fig, ax = plt.subplots(1, figsize = (20,10))
dane_mapa_woj.plot(column='liczba_logowan_w_wojewodztwie', ax=ax, cmap='YlOrRd', linewidth=0.8, edgecolor='gray', legend = True)
#dane_mapa_woj.apply(lambda x: ax.annotate(text=x.NUMBER, xy=x.geometry.centroid.coords[0], ha='center', color = "black"), axis=1)
dane_mapa_woj.apply(lambda x: ax.annotate(text=x.NAME, xy=x.geometry.centroid.coords[0], ha='center', color = "black"), axis=1)
ax.axis('off')
plt.show()
And my picture shows like below:
As you can see I have descriptions of each territoru by code: dane_mapa_woj.apply(lambda x: ax.annotate(text=x.NAME, xy=x.geometry.centroid.coords[0], ha='center', color = "black"), axis=1)
Nevertheless I would like to have both NAME and NUMBER on my plot, but when I use bothe these codes:
dane_mapa_woj.apply(lambda x: ax.annotate(text=x.NUMBER, xy=x.geometry.centroid.coords[0], ha='center', color = "black"), axis=1)
dane_mapa_woj.apply(lambda x: ax.annotate(text=x.NAME, xy=x.geometry.centroid.coords[0], ha='center', color = "black"), axis=1)
I have a strong mess on my picture:
My question is: how can I manage the position of NAME and NUMBER descriptions on the plot? Could you change my code to decrease this mess? I would like to have something like for example:
POMORSKIE
5742

