是否可以为 Geopandas 中的颜色映射设置边界?

Is it possible to set boundaries to the color mapping in Geopandas?

我正在使用 Geopandas.plot 绘制世界并使用 int 变量映射每个状态。我想知道是否仍然可以使用 int 变量来映射色谱的颜色和设置边界。更清楚地说,假设我有 2 个国家,第一个在 int 变量中的值为 2,第二个为 5。 geopandas.plot() 函数中的选项列将创建一个映射,其中边界是5和2,是否可以指定边界是,例如0和10?

是的,您只需指定 vminvmax

gdf.plot('variable', vmin=0, vmax=10)