Python 彩色地图的自定义标记
如何确定要在彩色地图上显示的数字 例如,GeoPandas自动显示Python 彩色地图的自定义标记,python,geopandas,Python,Geopandas,如何确定要在彩色地图上显示的数字 例如,GeoPandas自动显示0.2*10^9,0.4*10^9,0.6*10^9。。。等等如果我只想在正确的位置显示0、500000000和100000000,该怎么办 import geopandas as gpd world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres')) world.plot(column='pop_est', legend=True) 您可以使用参数le
0.2*10^9
,0.4*10^9
,0.6*10^9
。。。等等如果我只想在正确的位置显示0
、500000000
和100000000
,该怎么办
import geopandas as gpd
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
world.plot(column='pop_est', legend=True)
您可以使用参数
legend\u kwds
并将所需的记号作为列表传递
import matplotlib.pyplot as plt
import geopandas as gpd
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
world.plot(
column='pop_est',
legend=True,
legend_kwds={'ticks': [0,500000000,1000000000]}
)
plt.show()