I plot a figure as below:
plt.plot(lon,lat,'ro-')
plt.show()
but the lines aren't closed. How can I make them closed as polygons? thank you
I plot a figure as below:
plt.plot(lon,lat,'ro-')
plt.show()
but the lines aren't closed. How can I make them closed as polygons? thank you
使用matplotlib.pyplot.fill(lon,lat,fill=False)
而不是plot()
.
有关详细信息,请参阅http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.fill。颜色字符串指的是内部,所以要为多边形使用红色,请使用
plt.fill(lon, lat, edgecolor='r', fill=False)
如果需要,继续使用plot()
在顶点上放置圆圈。