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

Method set_sizes

lib/matplotlib/collections.py:1097–1119  ·  view source on GitHub ↗

Set the sizes of each member of the collection. Parameters ---------- sizes : `numpy.ndarray` or None The size to set for each element of the collection. The value is the 'area' of the element. dpi : float, default: 72 Th

(self, sizes, dpi=72.0)

Source from the content-addressed store, hash-verified

1095 return self._sizes
1096
1097 def set_sizes(self, sizes, dpi=72.0):
1098 """
1099 Set the sizes of each member of the collection.
1100
1101 Parameters
1102 ----------
1103 sizes : `numpy.ndarray` or None
1104 The size to set for each element of the collection. The
1105 value is the 'area' of the element.
1106 dpi : float, default: 72
1107 The dpi of the canvas.
1108 """
1109 if sizes is None:
1110 self._sizes = np.array([])
1111 self._transforms = np.empty((0, 3, 3))
1112 else:
1113 self._sizes = np.asarray(sizes)
1114 self._transforms = np.zeros((len(self._sizes), 3, 3))
1115 scale = np.sqrt(self._sizes) * dpi / 72.0 * self._factor
1116 self._transforms[:, 0, 0] = scale
1117 self._transforms[:, 1, 1] = scale
1118 self._transforms[:, 2, 2] = 1.0
1119 self.stale = True
1120
1121 @artist.allow_rasterization
1122 def draw(self, renderer):

Callers 6

drawMethod · 0.95
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
drawMethod · 0.45
__init__Method · 0.45

Calls 1

sqrtMethod · 0.80

Tested by

no test coverage detected