File tree 1 file changed +18
-1
lines changed 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 17
17
import matplotlib .cbook as cbook
18
18
import matplotlib .pyplot as plt
19
19
import matplotlib .scale as mscale
20
- from matplotlib .testing .decorators import image_comparison
20
+ from matplotlib .testing .decorators import image_comparison , check_figures_equal
21
21
22
22
23
23
@pytest .mark .parametrize ('N, result' , [
@@ -1439,3 +1439,20 @@ def test_scalarmappable_norm_update():
1439
1439
sm .stale = False
1440
1440
norm .vcenter = 1
1441
1441
assert sm .stale
1442
+
1443
+
1444
+ @check_figures_equal ()
1445
+ def test_norm_update_figs (fig_test , fig_ref ):
1446
+ ax_ref = fig_ref .add_subplot ()
1447
+ ax_test
74BD
= fig_test .add_subplot ()
1448
+
1449
+ z = np .arange (100 ).reshape ((10 , 10 ))
1450
+ ax_ref .imshow (z , norm = mcolors .Normalize (10 , 90 ))
1451
+
1452
+ # Create the norm beforehand with different limits and then update
1453
+ # after adding to the plot
1454
+ norm = mcolors .Normalize (0 , 1 )
1455
+ ax_test .imshow (z , norm = norm )
1456
+ # Force initial draw to make sure it isn't already stale
1457
+ fig_test .canvas .draw ()
1458
+ norm .vmin , norm .vmax = 10 , 90
You can’t perform that action at this time.
0 commit comments