@@ -72,22 +72,36 @@ def test_interp_nearest_vs_none():
72
72
ax2 .set_title ('interpolation nearest' )
73
73
74
74
75
- @image_comparison (baseline_images = ['figimage-0' , 'figimage-1' ], extensions = ['png' ])
76
- def test_figimage ():
75
+ def do_figimage (suppressComposite ):
76
+ """ Helper for the next two tests """
77
+ fig = plt .figure (figsize = (2 ,2 ), dpi = 100 )
78
+ fig .suppressComposite = suppressComposite
79
+ x ,y = np .ix_ (np .arange (100.0 )/ 100.0 , np .arange (100.0 )/ 100.0 )
80
+ z = np .sin (x ** 2 + y ** 2 - x * y )
81
+ c = np .sin (20 * x ** 2 + 50 * y ** 2 )
82
+ img = z + c / 5
83
+
84
+ fig .figimage (img , xo = 0 , yo = 0 , origin = 'lower' )
85
+ fig .figimage (img [::- 1 ,:], xo = 0 , yo = 100 , origin = 'lower' )
86
+ fig .figimage (img [:,::- 1 ], xo = 100 , yo = 0 , origin = 'lower' )
87
+ fig .figimage (img [::- 1 ,::- 1 ], xo = 100 , yo = 100 , origin = 'lower' )
88
+
89
+ @image_comparison (baseline_images = ['figimage-0' ],
90
+ extensions = ['png' ,'pdf' ])
91
+ def test_figimage0 ():
77
92
'test the figimage method'
78
93
79
- for suppressComposite in False , True :
80
- fig = plt .figure (figsize = (2 ,2 ), dpi = 100 )
81
- fig .suppressComposite = suppressComposite
82
- x ,y = np .ix_ (np .arange (100.0 )/ 100.0 , np .arange (100.0 )/ 100.0 )
83
- z = np .sin (x ** 2 + y ** 2 - x * y )
84
- c = np .sin (20 * x ** 2 + 50 * y ** 2 )
85
- img = z + c / 5
86
-
87
- fig .figimage (img , xo = 0 , yo = 0 , origin = 'lower' )
88
- fig .figimage (img [::- 1 ,:], xo = 0 , yo = 100 , origin = 'lower' )
89
- fig .figimage (img [:,::- 1 ], xo = 100 , yo = 0 , origin = 'lower' )
90
- fig .figimage (img [::- 1 ,::- 1 ], xo = 100 , yo = 100 , origin = 'lower' )
94
+ suppressComposite = False
95
+ do_figimage (suppressComposite )
96
+
97
+
98
+ @image_comparison (baseline_images = ['figimage-1' ],
99
+ extensions = ['png' ,'pdf' ])
100
+ def test_figimage1 ():
101
+ 'test the figimage method'
102
+ suppressComposite = True
103
+ do_figimage (suppressComposite )
104
+
91
105
92
106
def test_image_python_io ():
93
107
fig = plt .figure ()
0 commit comments