How to draw polygons with Python?

前端 未结 6 1003
南笙
南笙 2021-02-05 08:38

I have input values of x, y coordinates in the following format:

[[1,1], [2,1], [2,2], [1,2], [0.5,1.5]]

I want to draw polygons, but I don\'t

6条回答
  •  佛祖请我去吃肉
    2021-02-05 09:01

    All the other answers seems veryhigh level, I guess that is my impression as a mechanical engineer. Here's a simple version of the code:

    from numpy import *
    from matplotlib.pyplot import *
    x = ([1,2,2,1,0.5,1]) 
    y = ([1,1,2,2,1.5,1])
    plot(x,y)
    show()
    

提交回复
热议问题