A polygon-approximation of a circle patch.
| 1674 | |
| 1675 | |
| 1676 | class CirclePolygon(RegularPolygon): |
| 1677 | """A polygon-approximation of a circle patch.""" |
| 1678 | |
| 1679 | def __str__(self): |
| 1680 | s = "CirclePolygon((%g, %g), radius=%g, resolution=%d)" |
| 1681 | return s % (self.xy[0], self.xy[1], self.radius, self.numvertices) |
| 1682 | |
| 1683 | @_docstring.interpd |
| 1684 | def __init__(self, xy, radius=5, *, |
| 1685 | resolution=20, # the number of vertices |
| 1686 | ** kwargs): |
| 1687 | """ |
| 1688 | Create a circle at *xy* = (*x*, *y*) with given *radius*. |
| 1689 | |
| 1690 | This circle is approximated by a regular polygon with *resolution* |
| 1691 | sides. For a smoother circle drawn with splines, see `Circle`. |
| 1692 | |
| 1693 | Valid keyword arguments are: |
| 1694 | |
| 1695 | %(Patch:kwdoc)s |
| 1696 | """ |
| 1697 | super().__init__( |
| 1698 | xy, resolution, radius=radius, orientation=0, **kwargs) |
| 1699 | |
| 1700 | |
| 1701 | class Ellipse(Patch): |
no outgoing calls
no test coverage detected
searching dependent graphs…