编写一个代码能够读取shapefile,并画图
时间: 2024-02-01 22:02:41 浏览: 76
好的,我可以为您提供Python的代码示例,使用geopandas和matplotlib库来读取shapefile并绘制地图。请先确保您已经安装了这两个库。
```python
import geopandas as gpd
import matplotlib.pyplot as plt
# 读取shapefile
data = gpd.read_file('your_shapefile.shp')
# 绘制地图
fig, ax = plt.subplots(figsize=(10,10))
data.plot(ax=ax)
plt.show()
```
您只需要将 `your_shapefile.shp` 替换为您的shapefile文件名即可。此外,您可以根据需要调整图形的大小和其他绘图参数。
阅读全文
相关推荐












