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

Method set_offsets

lib/matplotlib/collections.py:625–641  ·  view source on GitHub ↗

Set the offsets for the collection. Parameters ---------- offsets : (N, 2) or (2,) array-like

(self, offsets)

Source from the content-addressed store, hash-verified

623 return self._hatch_linewidth
624
625 def set_offsets(self, offsets):
626 """
627 Set the offsets for the collection.
628
629 Parameters
630 ----------
631 offsets : (N, 2) or (2,) array-like
632 """
633 offsets = np.asanyarray(offsets)
634 if offsets.shape == (2,): # Broadcast (2,) -> (1, 2) but nothing else.
635 offsets = offsets[None, :]
636 cstack = (np.ma.column_stack if isinstance(offsets, np.ma.MaskedArray)
637 else np.column_stack)
638 self._offsets = cstack(
639 (np.asanyarray(self.convert_xunits(offsets[:, 0]), float),
640 np.asanyarray(self.convert_yunits(offsets[:, 1]), float)))
641 self.stale = True
642
643 def get_offsets(self):
644 """Return the offsets for the collection."""

Callers

nothing calls this directly

Calls 2

convert_xunitsMethod · 0.80
convert_yunitsMethod · 0.80

Tested by

no test coverage detected