我有一个shapefile要显示。我尝试使用matplotlib来显示它,但是我得到了:
但是,当我尝试使用在线网站进行展示时,我得到了;

如何获得第二张图像?
这是我的代码:
import shapefile
import matplotlib.pyplot as plt
print("Initializing Shapefile")
sf = shapefile.Reader("ap_abl")
apShapes = sf.shapes()
points = apShapes[3].points
print("Shapefile Initialized")
print("Initializing Display")
fig = plt.figure()
ax = fig.add_subplot(111)
plt.xlim([78, 79])
plt.ylim([19, 20])
print("Display Initialized")
print("Creating Polygon")
ap = plt.Polygon(points, fill=False, edgecolor="k")
ax.add_patch(ap)
print("Polygon Created")
print("Displaying polygon")
plt.show()
Run Code Online (Sandbox Code Playgroud)
先感谢您。