matplotlib:plot a line closed

后端 未结 1 1895
借酒劲吻你
借酒劲吻你 2021-01-20 03:13

I plot a figure as below:

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

\"enter

相关标签:
1条回答
  • 2021-01-20 03:58

    Use matplotlib.pyplot.fill(lon,lat,fill=False) instead of plot().

    See http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.fill for details. The color string refers to the interior, so to use red for the polygon, use

    plt.fill(lon, lat, edgecolor='r', fill=False)
    

    and continue to use plot() to place circles on the vertices if desired.

    0 讨论(0)
提交回复
热议问题