title: Python & Matplot: How can I draw a simple shape by points?
body: <p>I just want to draw simple shape by points, like this:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  rectangle = [(0,0),(0,1),(1,1),(1,0)]
  hexagon = [(0,0),(0,1),(1,2),(2,1),(2,0),(1,-1)]
  l_shape = [(0,0),(0,3),(1,3),(1,1),(3,1),(3,0)]
  concave = [(0,0),(0,3),(1,3),(1,1),(2,1),(2,3),(3,3),(3,0)]
  
  for points in [rectangle, hexagon, l_shape, concave]:
      # 1. Can I get rid of the zip? plot directly by points 
      # 2. How can I make the shape complete?
      xs, ys = zip(*points)
      plt.plot(xs, ys, 'o')
      plt.plot(xs, ys, '-')
  
      automin, automax = plt.xlim()
      plt.xlim(automin-0.5, automax+0.5)
      automin, automax = plt.ylim()
      plt.ylim(automin-0.5, automax+0.5)
      # Can I display the shapes 2 in 1 line?
      plt.show()
  </code></pre>
  
  <p>My question is 
  <img src="https://i.stack.imgur.com/ec18h.png" alt="enter image description here"></p>
  
  <ol>
  <li>How can I get rid of the <code>*zip</code>? I mean, directyly draw by points, rather than 2 array.</li>
  <li>How to make these shapes <code>complete</code>? Since I'm looping through all the points, the first and last cannot connect together, how can I do it?</li>
  <li>Can I draw the shape without giving the specific points order?(Something like <code>convex hull</code>?)</li>
  </ol>