I use matplotlib.animation to animate data in a 3D array named arr. I read data from a h5 file using h5py library and everything is OK
matplotlib.animation
arr
h5py
I think you want to replace set_clim() with
set_clim()
p.autoscale()
With no arguments, set_clim() is a no-op.
That said, changing your color scale in the middle of an animations seems very misleading.
You should also use set_data instead of set_array (according to the docs).
set_data
set_array