python - matplotlib:plot a line closed -


i plot figure below:

plt.plot(lon,lat,'ro-') plt.show() 

enter image description here

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

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -