There are multiple thing I want to edit with the colorbar in a geopandas world choropleth I'm creating. Namely the size (so that it roughly matches the map itself), the text size (which currently shows up far too small) and I also wanted to add a label to it. It seems from reading about a bit there's no easy way of doing that explicitly within geopandas and so i was wondering if anyone might have any workarounds at all to offer? Any help would be greatly appreciated.
This is the piece of code I'm currently using (for some context the mid section is simply merging lists with figures by country, which I'm using as the basis of the colouring, to the frame)
fig, ax = plt.subplots(figsize=(40,29.171))
world = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres'))
world=pd.DataFrame(world)
world['LEADS']=0.1
world = world.set_index('name')
world['name']=world.index
for x, y in zip(Countries, country_counts):
world.loc[x, 'LEADS'] = y
world=geopandas.GeoDataFrame(world)
world = world[(world.index != "Antarctica")]
ax.set_axis_off()
#ax.legend(title="Leads")
world.plot(ax=ax, column='LEADS', cmap='Oranges', legend=True,linewidth = 1.5)
plt.tight_layout()
plt.savefig('plot_image.png', bbox_inches='tight', transparent=True)
An ideal solution here would maintain the colours that the legend option has, specify size and text size and enable a label at the top of the bar. I'm struglling to work out how any of this is done myself unfortunatley.