def get_anchor_index(index, freq): ideal = get_time_index(freq) start = index[0] start = ideal.asof(start) end = index[-1] start, end = _get_range_edges(index, offset=freq, closed='right') ind = DatetimeIndex(start=start, end=end, freq=freq) return ind
def generate_xticks(self, index, freq): """ Ticks are really just the bin edges. """ start = index[0] end = index[-1] start, end = _get_range_edges(index, offset=freq, closed='right') ind = DatetimeIndex(start=start, end=end, freq=freq) bins = lib.generate_bins_dt64(index.asi8, ind.asi8, closed='right') bins = np.unique(bins) return bins