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

Method _make_verts

lib/matplotlib/collections.py:1512–1535  ·  view source on GitHub ↗

Make verts that can be forwarded to `.PolyCollection`.

(self, t, f1, f2, where)

Source from the content-addressed store, hash-verified

1510 return datalim
1511
1512 def _make_verts(self, t, f1, f2, where):
1513 """
1514 Make verts that can be forwarded to `.PolyCollection`.
1515 """
1516 self._validate_shapes(self.t_direction, self._f_direction, t, f1, f2)
1517
1518 where = self._get_data_mask(t, f1, f2, where)
1519 t, f1, f2 = np.broadcast_arrays(np.atleast_1d(t), f1, f2, subok=True)
1520
1521 self._bbox = transforms.Bbox.null()
1522 t_where = t.data[where] if np.ma.isMA(t) else t[where]
1523 f1_where = f1.data[where] if np.ma.isMA(f1) else f1[where]
1524 f2_where = f2.data[where] if np.ma.isMA(f2) else f2[where]
1525 n = len(t_where)
1526 if n > 0:
1527 pts = np.empty((2 * n, 2)) # Preallocate and fill for speed
1528 pts[:n, 0], pts[:n, 1] = t_where, f1_where
1529 pts[n:, 0], pts[n:, 1] = t_where, f2_where
1530 self._bbox.update_from_data_xy(self._fix_pts_xy_order(pts))
1531
1532 return [
1533 self._make_verts_for_region(t, f1, f2, idx0, idx1)
1534 for idx0, idx1 in cbook.contiguous_regions(where)
1535 ]
1536
1537 def _get_data_mask(self, t, f1, f2, where):
1538 """

Callers 2

__init__Method · 0.95
set_dataMethod · 0.95

Calls 6

_validate_shapesMethod · 0.95
_get_data_maskMethod · 0.95
_fix_pts_xy_orderMethod · 0.95
nullMethod · 0.80
update_from_data_xyMethod · 0.80

Tested by

no test coverage detected