File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def draw_image(data, obj):
29
29
30
30
if obj .origin == "lower" :
31
31
img_array = numpy .flipud (img_array )
32
-
32
+
33
33
dims = img_array .shape
34
34
if len (dims ) == 2 : # the values are given as one real number: look at cmap
35
35
clims = obj .get_clim ()
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def get_tikz_code(
30
30
extra_tikzpicture_parameters = None ,
31
31
dpi = None ,
32
32
show_info = True
33
- ):
33
+ ):
34
34
'''Main function. Here, the recursion into the image starts and the
35
35
contents are picked up. The actual file gets written in this routine.
36
36
Original file line number Diff line number Diff line change 11
11
except ImportError :
12
12
raise RuntimeError ('PIL must be installed to run this example' )
13
13
14
- #the picture 'lena.png' with origin='lower' is flipped upside-down. So it has to be upside-down in the pdf-file as well.
14
+ # the picture 'lena.png' with origin='lower' is flipped upside-down.
15
+ # So it has to be upside-down in the pdf-file as well.
15
16
16
- def plot1 (): #test for monochrome picture
17
+ # test for monochrome picture
18
+ def plot1 ():
17
19
18
20
this_dir = os .path .dirname (os .path .realpath (__file__ ))
19
21
lena = Image .open (os .path .join (this_dir , 'lena.png' ))
@@ -29,7 +31,9 @@ def plot1(): #test for monochrome picture
29
31
pp .colorbar ()
30
32
return fig
31
33
32
- def plot2 (): #test for rgb picture
34
+
35
+ # test for rgb picture
36
+ def plot2 ():
33
37
34
38
this_dir = os .path .dirname (os .path .realpath (__file__ ))
35
39
lena = Image .open (os .path .join (this_dir , 'lena.png' ))
@@ -44,14 +48,13 @@ def plot2(): #test for rgb picture
44
48
pp .colorbar ()
45
49
return fig
46
50
51
+
47
52
@pytest .mark .parametrize (
48
53
'plot, phash' , [
49
54
(plot1 , '455361ec211d72fb' ),
50
55
(plot2 , '7558d3b30f634b06' ),
51
56
]
52
57
)
53
-
54
58
def test (plot , phash ):
55
59
helpers .assert_phash (plot (), phash )
56
- return
57
-
60
+ return
You can’t perform that action at this time.
0 commit comments