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

Method center_of_mass

galleries/examples/misc/packed_bubbles.py:59–62  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

57 self.com = self.center_of_mass()
58
59 def center_of_mass(self):
60 return np.average(
61 self.bubbles[:, :2], axis=0, weights=self.bubbles[:, 3]
62 )
63
64 def center_distance(self, bubble, bubbles):
65 return np.hypot(bubble[0] - bubbles[:, 0],

Callers 2

__init__Method · 0.95
collapseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected