matplotlib/matplotlib — pull request #1018 by jakevdp (2012-07-17 03:32:51+00:00)
Title: BUG: check for closed path in Polygon.set_xy()

This was something unexpected I came across: I had to dig through the code to see why it didn't behave as I thought it should. I'm not sure whether it should be changed (I can see arguments both ways) but I thought I'd bring it up just in case.

Former behavior:

```
>>> xy = [[0,0], [0,1], [1,1]]
>>> p = Polygon(xy, closed=True)
>>> p.get_xy()
array([[ 0., 0.],
[ 0., 1.],
[ 1., 1.],
[ 0., 0.]])
>>> p.set_xy(xy)
>>> p.get_xy()
array([[ 0., 0.],
[ 0., 1.],
[ 1., 1.]])
```

This PR changes things so the second output is the same as the first, for both `closed = True` and `closed = False`.