File tree 2 files changed +7
-3
lines changed 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,10 @@ def _trim_ticks(self, ticks):
235
235
return ticks
236
236
vmin = self ._colorbar .norm .vmin
237
237
vmax = self ._colorbar .norm .vmax
238
- trans = self ._colorbar .norm ._scale ._transform .transform
238
+ if hasattr (self ._colorbar .norm , '_scale' ):
239
+ trans = self ._colorbar .norm ._scale ._transform .transform
240
+ else :
241
+ trans = mtransforms .IdentityTransform ().transform
239
242
rtol = (trans (vmax ) - trans (vmin )) * 1e-10
240
243
good = ((trans (ticks ) >= trans (vmin ) - rtol ) &
241
244
(trans (ticks ) <= trans (vmax ) + rtol ))
@@ -607,7 +610,8 @@ def update_ticks(self):
607
610
_log .debug ('Using auto colorbar locator %r on colorbar' ,
608
611
self .locator )
609
612
self ._long_axis ().set_major_locator (self .locator )
610
- self ._long_axis ().set_minor_locator (self .minorlocator )
613
+ if self .minorlocator is not None :
614
+ self ._long_axis ().set_minor_locator (self .minorlocator )
611
615
self ._long_axis ().set_major_formatter (self .formatter )
612
616
else :
613
617
_log .debug ('Using fixed locator on colorbar' )
Original file line number Diff line number Diff line change @@ -786,7 +786,7 @@ def test_image_preserve_size2():
786
786
np .identity (n , bool )[::- 1 ])
787
787
788
788
789
- @image_comparison (['mask_image_over_under.png' ], remove_text = True , tol = 1.0 )
789
+ @image_comparison (['mask_image_over_under.png' ], remove_text = False , tol = 1.0 )
790
790
def test_mask_image_over_under ():
791
791
# Remove this line when this test image is regenerated.
792
792
plt .rcParams ['pcolormesh.snap' ] = False
You can’t perform that action at this time.
0 commit comments