@@ -395,6 +395,12 @@ def imshow(
395
395
args ["animation_frame" ] = ( # TODO
396
396
"slice" if labels .get ("slice" ) is None else labels ["slice" ]
397
397
)
398
+ iterables = ()
399
+ if slice_through :
400
+ if animation_frame is not None :
401
+ iterables += (range (nslices_animation ),)
402
+ if facet_col is not None :
403
+ iterables += (range (nslices_facet ),)
398
404
399
405
# Default behaviour of binary_string: True for RGB images, False for 2D
400
406
if binary_string is None :
@@ -451,12 +457,6 @@ def imshow(
451
457
"The length of the x vector must match the length of the second "
452
458
+ "dimension of the img matrix."
453
459
)
454
- iterables = ()
455
- if slice_through :
456
- if animation_frame is not None :
457
- iterables += (range (nslices_animation ),)
458
- if facet_col is not None :
459
- iterables += (range (nslices_facet ),)
460
460
traces = [
461
461
go .Heatmap (x = x , y = y , z = img [index_tup ], coloraxis = "coloraxis1" , name = str (i ))
462
462
for i , index_tup in enumerate (itertools .product (* iterables ))
@@ -488,12 +488,6 @@ def imshow(
488
488
_vectorize_zvalue (zmin , mode = "min" ),
489
489
_vectorize_zvalue (zmax , mode = "max" ),
490
490
)
491
- iterables = ()
492
- if slice_through :
493
- if animation_frame is not None :
494
- iterables += (range (nslices_animation ),)
495
- if facet_col is not None :
496
- iterables += (range (nslices_facet ),)
497
491
if binary_string :
498
492
if zmin is None and zmax is None : # no rescaling, faster
499
493
img_rescaled = img
0 commit comments