import geopandas as gpd
world = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
world_test = world.iloc[:10]
patterns = ["." * i for i in range(1, len(world_test)+1)]
names = world_test.name
pattern_dict = dict(zip(names, patterns))
import matplotlib.pyplot as plt
fig, ax = plt.subplots(figsize=(20,15))
for name, pattern in pattern_dict.items():
# 我这里的hatch就是填充的点的密度,也可以用其他的标记填充。 指定ax是为了绘制在一起。
world_test[world_test['name']==name].plot(hatch=pattern, ax=ax)