Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions datastock/_class2_interactivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,18 @@ def _get_ix_for_refx_only_1or2d(


def get_fupdate(handle=None, dtype=None, norm=None, bstr=None):

# Note: set_xdata() and set_ydata() do not accept scalar values
# Deprecation warning since matplotlib 3.7
# see https://github.com/matplotlib/matplotlib/pull/22329
# see https://github.com/matplotlib/matplotlib/issues/28927

if dtype == 'xdata':
def func(val, handle=handle):
handle.set_xdata(val)
handle.set_xdata(np.atleast_1d(val))
elif dtype == 'ydata':
def func(val, handle=handle):
handle.set_ydata(val)
handle.set_ydata(np.atleast_1d(val))
elif dtype in ['data']: # Also works for imshow
def func(val, handle=handle):
handle.set_data(val)
Expand Down Expand Up @@ -588,4 +594,4 @@ def _update_mobile(k0=None, dmobile=None, dref=None, ddata=None):
# ddata[dmobile[k0]['data'][ii]]['data'][
# dmobile[k0]['func_slice'][ii](iref[ii])
# ]
# )
# )
Loading