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

Method _find_tails

lib/matplotlib/quiver.py:998–1028  ·  view source on GitHub ↗

Find how many of each of the tail pieces is necessary. Parameters ---------- mag : `~numpy.ndarray` Vector magnitudes; must be non-negative (and an actual ndarray). rounding : bool, default: True Whether to round or to truncate to the

(self, mag, rounding=True, half=5, full=10, flag=50)

Source from the content-addressed store, hash-verified

996 self.set_UVC(u, v, c)
997
998 def _find_tails(self, mag, rounding=True, half=5, full=10, flag=50):
999 """
1000 Find how many of each of the tail pieces is necessary.
1001
1002 Parameters
1003 ----------
1004 mag : `~numpy.ndarray`
1005 Vector magnitudes; must be non-negative (and an actual ndarray).
1006 rounding : bool, default: True
1007 Whether to round or to truncate to the nearest half-barb.
1008 half, full, flag : float, defaults: 5, 10, 50
1009 Increments for a half-barb, a barb, and a flag.
1010
1011 Returns
1012 -------
1013 n_flags, n_barbs : int array
1014 For each entry in *mag*, the number of flags and barbs.
1015 half_flag : bool array
1016 For each entry in *mag*, whether a half-barb is needed.
1017 empty_flag : bool array
1018 For each entry in *mag*, whether nothing is drawn.
1019 """
1020 # If rounding, round to the nearest multiple of half, the smallest
1021 # increment
1022 if rounding:
1023 mag = half * np.around(mag / half)
1024 n_flags, mag = divmod(mag, flag)
1025 n_barb, mag = divmod(mag, full)
1026 half_flag = mag >= half
1027 empty_flag = ~(half_flag | (n_flags > 0) | (n_barb > 0))
1028 return n_flags.astype(int), n_barb.astype(int), half_flag, empty_flag
1029
1030 def _make_barbs(self, u, v, nflags, nbarbs, half_barb, empty_flag, length,
1031 pivot, sizes, fill_empty, flip):

Callers 1

set_UVCMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected