MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / Circle

Class Circle

lib/matplotlib/patches.py:2068–2107  ·  view source on GitHub ↗

A circle patch.

Source from the content-addressed store, hash-verified

2066
2067
2068class Circle(Ellipse):
2069 """
2070 A circle patch.
2071 """
2072 def __str__(self):
2073 pars = self.center[0], self.center[1], self.radius
2074 fmt = "Circle(xy=(%g, %g), radius=%g)"
2075 return fmt % pars
2076
2077 @_docstring.interpd
2078 def __init__(self, xy, radius=5, **kwargs):
2079 """
2080 Create a true circle at center *xy* = (*x*, *y*) with given *radius*.
2081
2082 Unlike `CirclePolygon` which is a polygonal approximation, this uses
2083 Bezier splines and is much closer to a scale-free circle.
2084
2085 Valid keyword arguments are:
2086
2087 %(Patch:kwdoc)s
2088 """
2089 super().__init__(xy, radius * 2, radius * 2, **kwargs)
2090 self.radius = radius
2091
2092 def set_radius(self, radius):
2093 """
2094 Set the radius of the circle.
2095
2096 Parameters
2097 ----------
2098 radius : float
2099 """
2100 self.width = self.height = 2 * radius
2101 self.stale = True
2102
2103 def get_radius(self):
2104 """Return the radius of the circle."""
2105 return self.width / 2.
2106
2107 radius = property(get_radius, set_radius)
2108
2109
2110class Arc(Ellipse):

Callers 15

test_patch_modificationFunction · 0.90
test_anchored_artistsFunction · 0.90
_gen_axes_patchMethod · 0.90
test_clip_path_ids_reuseFunction · 0.90
plot_pathsFunction · 0.90
annotations.pyFile · 0.90
_gen_axes_patchMethod · 0.90
pathpatch3d.pyFile · 0.90
dolphin.pyFile · 0.90

Calls

no outgoing calls

Tested by 6

test_patch_modificationFunction · 0.72
test_anchored_artistsFunction · 0.72
test_clip_path_ids_reuseFunction · 0.72
plot_pathsFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…