彩色条太大-Python Matplotlib

我想绘制来自布宜诺斯艾利斯的地理数据框,即贫穷房屋的比例。有代码:

import pandas as pd
import geopandas as gpd
import matplotlib.pyplot as plt
caba=gpd.read_file('https://bitsandbricks.github.io/data/CABA_rc.geojson')

问题:颜色栏太大。我尝试传递一些“ legend_kwds”,但出现错误。

fig,ax = plt.subplots(figsize=(10,10))
ax.set_aspect('equal')


caba.plot(ax=ax,column='HOGARES_NBI',cmap='viridis',edgecolor='grey',linewidth=0.01,facecolor='r',legend=True,legend_kwds={})

plt.title('Proporción de hogares \n con al menos una necesidad básica insatisfecha',fontsize=15)
ax.set_axis_off()

Here's the image of the really BIG colorbar

我尝试通过{'prop':{'size':2}},但是它不起作用。

错误:__init__() got an unexpected keyword argument 'prop'

谢谢!

tzyyhjb 回答:彩色条太大-Python Matplotlib

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3112726.html

大家都在问