MCPcopy Create free account
hub / github.com/DeepLabCut/DeepLabCut / draw

Method draw

deeplabcut/core/trackingutils.py:129–151  ·  view source on GitHub ↗
(self, show_axes=True, ax=None, **kwargs)

Source from the content-addressed store, hash-verified

127 ) <= 1 + tol
128
129 def draw(self, show_axes=True, ax=None, **kwargs):
130 import matplotlib.pyplot as plt
131 from matplotlib.lines import Line2D
132 from matplotlib.transforms import Affine2D
133
134 if ax is None:
135 ax = plt.subplot(111, aspect="equal")
136 el = patches.Ellipse(
137 xy=(self.x, self.y),
138 width=self.width,
139 height=self.height,
140 angle=np.rad2deg(self.theta),
141 **kwargs,
142 )
143 ax.add_patch(el)
144 if show_axes:
145 major = Line2D([-self.width / 2, self.width / 2], [0, 0], lw=3, zorder=3)
146 minor = Line2D([0, 0], [-self.height / 2, self.height / 2], lw=3, zorder=3)
147 trans = Affine2D().rotate(self.theta).translate(self.x, self.y) + ax.transData
148 major.set_transform(trans)
149 minor.set_transform(trans)
150 ax.add_artist(major)
151 ax.add_artist(minor)
152
153
154class EllipseFitter:

Callers 4

on_pressMethod · 0.80
delete_dataMethod · 0.80
on_releaseMethod · 0.80
on_scrollMethod · 0.80

Calls 1

rotateMethod · 0.80

Tested by

no test coverage detected