# Image is upside down using Plots.plot

**URL:** <https://discourse.julialang.org/t/image-is-upside-down-using-plots-plot/29637>\
**Category:** New to Julia\
**Tags:** plotting\
**Created:** [October 8, 2019, 6:12am UTC](https://discourse.julialang.org/t/image-is-upside-down-using-plots-plot/29637 "2019-10-08T06:12:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![helloBrisbane](https://avatars.discourse-cdn.com/v4/letter/h/8e7dd6/32.png) [@helloBrisbane](https://discourse.julialang.org/u/helloBrisbane)\
**Post date:** [October 8, 2019, 6:12am UTC](https://discourse.julialang.org/t/image-is-upside-down-using-plots-plot/29637/1 "2019-10-08T06:12:25Z")

</div>

hi Guys,  
I am trying to use Plots.plot to save images in REPL on ubuntu. However it always save the picture upside down even if I have not do anything on the image yet.  
Please help.

julia Version 1.1.1 (2019-05-16)

using Plots,Images  
backend()  
#Plots.GRBackend()  
pic=Images.load(“image\_orig.png”);  
Plots.plot(pic);  
Plots.savefig(“myplot\_test.png”)  
#open the picture of myplot\_test.png in browser, the pic is upside down

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [October 8, 2019, 7:47am UTC](https://discourse.julialang.org/t/image-is-upside-down-using-plots-plot/29637/2 "2019-10-08T07:47:54Z")

</div>

I’m not very familiar with Plots.jl but try setting `yflip = true`, it’s quite common for plotting packages to put (0,0) on the top left corner instead of the bottom left.

---

<div class="post-metadata">

**Author:** ![helloBrisbane](https://avatars.discourse-cdn.com/v4/letter/h/8e7dd6/32.png) [@helloBrisbane](https://discourse.julialang.org/u/helloBrisbane)\
**Post date:** [October 9, 2019, 3:33am UTC](https://discourse.julialang.org/t/image-is-upside-down-using-plots-plot/29637/3 "2019-10-09T03:33:21Z")

</div>

Thanks.

however, it does not help for both yflip = true and false

Plots.plot(pic, yflip = true)

#still upside down

Plots.plot(pic, yflip = false)

#still upside down

---

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [October 9, 2019, 6:48am UTC](https://discourse.julialang.org/t/image-is-upside-down-using-plots-plot/29637/4 "2019-10-09T06:48:06Z")

</div>

This works fine on my Windows 10 computer. I have not used this package before, but I just added `Images` and `ImageMagick`, and get:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/9/4930e49bca78ea92887dd263483ddfbd3a4900bc.jpeg)

If I use `pyplot` as backend while plotting, I get:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/a/aaf8b822c37d45cc69025a817c5373f780cdd79f.jpeg)

If I change and use backend `gr()` instead, I get exactly the same result.

---

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [October 9, 2019, 6:53am UTC](https://discourse.julialang.org/t/image-is-upside-down-using-plots-plot/29637/5 "2019-10-09T06:53:18Z")

</div>

NB: this also works with `*.png` files on my computer.

---

<div class="post-metadata">

**Author:** ![helloBrisbane](https://avatars.discourse-cdn.com/v4/letter/h/8e7dd6/32.png) [@helloBrisbane](https://discourse.julialang.org/u/helloBrisbane)\
**Post date:** [October 9, 2019, 10:29pm UTC](https://discourse.julialang.org/t/image-is-upside-down-using-plots-plot/29637/6 "2019-10-09T22:29:56Z")

</div>

I am using Ubuntu

---

<div class="post-metadata">

**Author:** ![dcasbol](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dcasbol/32/18756_2.png) [@dcasbol](https://discourse.julialang.org/u/dcasbol)\
**Post date:** [November 2, 2021, 9:53am UTC](https://discourse.julialang.org/t/image-is-upside-down-using-plots-plot/29637/7 "2021-11-02T09:53:35Z")

</div>

I’m facing a similar problem. It seems that image plotting won’t flip the y axis no matter how you put it. I’ve managed to go around that by reversing the array itself: `plot(img[end:-1:begin,:])` but of course that leaves now the y-ticks in the wrong order.
