mpl_interactions.indexer

indexer(arr, axis=0, index_name=None)[source]

Utility function for when you want to index an array as part of an interactive function. For example: iplt.plot(indexor(arr), idx = np.arange(5))

Parameters
  • arr (arraylike) – The array to be indexed

  • axis (int) – which axis to index, default to first axis

  • index_name (str, default: None) – The name of the variable the returned function should expect to receive. If None then the function will check for idx, index, ind, and indx.

Returns

f (function) – Function to be passed as an argument to an interactive plotting function