You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change the image data (using the set_data method): the new data array must have a different shape than the initial one
After a call to replot(), the image is shown as expected with the new dimensions
Change the colormap
When refreshed, the image axes are changed (so that the min/max X/Y values match the initial array dimensions)
It is also possible to reproduce the issue by modifying the test plotpy/tests/features/test_image_data_update.py. Simply replace the get_data function by the following (and when running the test, change the colormap):
defget_data() ->np.ndarray:
"""Compute 2D Gaussian data and add a narrower Gaussian on top with a random position and amplitude."""size=np.random.randint(50, 200)
dtype=np.uint16amp=np.iinfo(dtype).max*0.3data=ptd.gen_2d_gaussian(size, dtype, sigma=10.0, x0=0.0, y0=0.0, amp=amp)
# Choose a random position: x0, y0 have to be in the range [-10.0, 10.0]x0=np.random.uniform(-10.0, 10.0)
y0=np.random.uniform(-10.0, 10.0)
# Choose a random amplitude: a has to be in the range [0.1, 0.5]a=np.random.uniform(0.1, 0.7) *np.iinfo(dtype).max# Add the narrower Gaussian on topdata+=ptd.gen_2d_gaussian(size, dtype, sigma=4.0, x0=x0, y0=y0, amp=a)
returndata
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
ImageItem
objectset_data
method): the new data array must have a different shape than the initial onereplot()
, the image is shown as expected with the new dimensionsIt is also possible to reproduce the issue by modifying the test plotpy/tests/features/test_image_data_update.py. Simply replace the
get_data
function by the following (and when running the test, change the colormap):The text was updated successfully, but these errors were encountered: