I'm stuck on something that should be simple, but I couldn't find an answer. I'm trying to plot something, like this:
world['gdp_per_cap'] = world.gdp_md_est / world.pop_est
world.plot(column='gdp_md_est', legend = True)
Which brings this:
But I'd like to change the colorbar (and the color mapping) so it goes from 0 to 3e7. Tried to do it through legend_kwds
, read about vmin
, vmax
and plt.colorbar()
, but couldn't find a way to combine that knowledge into custom boundaries/limits for my colorbar. What am i missing?
Thanks!
CodePudding user response:
Just add vmax/vmin in the plot. if you want to change the colormap, just pass the name to cmap.
world.plot(column='gdp_md_est', legend = True,vmin = 0.5e7,max=1.75e7, cmap='Reds')