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 foridx
,index
,ind
, andindx
.
- Returns
f (function) – Function to be passed as an argument to an interactive plotting function