MCPcopy Index your code
hub / github.com/pydata/xarray / _resolve_intervals_2dplot

Function _resolve_intervals_2dplot

xarray/plot/utils.py:648–662  ·  view source on GitHub ↗

Helper function to replace the values of a coordinate array containing pd.Interval with their mid-points or - for pcolormesh - boundaries which increases length by 1.

(val, func_name)

Source from the content-addressed store, hash-verified

646
647
648def _resolve_intervals_2dplot(val, func_name):
649 """
650 Helper function to replace the values of a coordinate array containing
651 pd.Interval with their mid-points or - for pcolormesh - boundaries which
652 increases length by 1.
653 """
654 label_extra = ""
655 if _valid_other_type(val, pd.Interval):
656 if func_name == "pcolormesh":
657 val = _interval_to_bound_points(val)
658 else:
659 val = _interval_to_mid_points(val)
660 label_extra = "_center"
661
662 return val, label_extra
663
664
665def _valid_other_type(

Callers 1

newplotfuncFunction · 0.90

Calls 3

_valid_other_typeFunction · 0.85
_interval_to_mid_pointsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…