python - matplotlib:plot a line closed -
i plot figure below:
plt.plot(lon,lat,'ro-') plt.show()
but lines aren't closed. how can make them closed polygons? thank you
use matplotlib.pyplot.fill(lon,lat,fill=false)
instead of plot()
.
see http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.fill details. color string refers interior, use red polygon, use
plt.fill(lon, lat, edgecolor='r', fill=false)
and continue use plot()
place circles on vertices if desired.
Comments
Post a Comment