We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7a314e commit a20cf6dCopy full SHA for a20cf6d
matplotlib2tikz/image.py
@@ -27,9 +27,6 @@ def draw_image(data, obj):
27
# store the image as in a file
28
img_array = obj.get_array()
29
30
- if obj.origin == "lower":
31
- img_array = numpy.flipud(img_array)
32
-
33
dims = img_array.shape
34
if len(dims) == 2: # the values are given as one real number: look at cmap
35
clims = obj.get_clim()
@@ -45,6 +42,8 @@ def draw_image(data, obj):
45
42
# RGB (+alpha) information at each point
46
43
assert len(dims) == 3 and dims[2] in [3, 4]
47
44
# convert to PIL image
+ if obj.origin == "lower":
+ img_array = numpy.flipud(img_array)
48
image = PIL.Image.fromarray(img_array)
49
image.save(filename, origin=obj.origin)
50
0 commit comments