MCPcopy
hub / github.com/pydata/xarray / ticks

Method ticks

xarray/plot/utils.py:1582–1598  ·  view source on GitHub ↗

Return ticks for plt.colorbar if the data is not numeric. Examples -------- >>> a = xr.DataArray(["b", "a", "a", "b", "c"]) >>> _Normalize(a).ticks array([1, 3, 5])

(self)

Source from the content-addressed store, hash-verified

1580
1581 @property
1582 def ticks(self) -> np.ndarray | None:
1583 """
1584 Return ticks for plt.colorbar if the data is not numeric.
1585
1586 Examples
1587 --------
1588 >>> a = xr.DataArray(["b", "a", "a", "b", "c"])
1589 >>> _Normalize(a).ticks
1590 array([1, 3, 5])
1591 """
1592 val: np.ndarray | None
1593 if self.data_is_numeric:
1594 val = None
1595 else:
1596 val = self._indexes_centered(self._data_unique_index)
1597
1598 return val
1599
1600 @property
1601 def levels(self) -> np.ndarray:

Callers

nothing calls this directly

Calls 1

_indexes_centeredMethod · 0.95

Tested by

no test coverage detected