# AxisArray plotted by Plots.jl

**URL:** <https://discourse.julialang.org/t/axisarray-plotted-by-plots-jl/3972>\
**Category:** Visualization\
**Tags:** plotting\
**Created:** [May 29, 2017, 10:58am UTC](https://discourse.julialang.org/t/axisarray-plotted-by-plots-jl/3972 "2017-05-29T10:58:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![phlavenk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/phlavenk/32/1873_2.png) [@phlavenk](https://discourse.julialang.org/u/phlavenk)\
**Post date:** [May 29, 2017, 10:58am UTC](https://discourse.julialang.org/t/axisarray-plotted-by-plots-jl/3972/1 "2017-05-29T10:58:19Z")

</div>

Hi,  
is there a way to display an image defined using AxisArray into a plot with XY axes and scaled properly?

```julia
using Images, ImageAxes, Plots
img = colorview(Gray, reshape(linspace(0,1, 10000), 100, 100))
imx = AxisArray(img, Axis{:x}(linspace(-0.1, 0.1,size(img,1) )),
                Axis{:y}(linspace(-0.1, 0.1,size(img,2) )))
plot(imx)

```

I’d like to develop a PlotRecipe that would position the image matrix to the right place. Is there any example or tutorial how to achieve this axis transformation using PlotRecipes?  
Thank you for your hints.

Petr

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [May 29, 2017, 11:21am UTC](https://discourse.julialang.org/t/axisarray-plotted-by-plots-jl/3972/2 "2017-05-29T11:21:19Z")

</div>

It’s a nice idea, I am not sure this is possible with just a recipe, though, but it should definitely be feasible to have this functionality. Try and have a look at how images are handled in the Plots code.

---

<div class="post-metadata">

**Author:** ![phlavenk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/phlavenk/32/1873_2.png) [@phlavenk](https://discourse.julialang.org/u/phlavenk)\
**Post date:** [May 30, 2017, 5:02am UTC](https://discourse.julialang.org/t/axisarray-plotted-by-plots-jl/3972/3 "2017-05-30T05:02:01Z")

</div>

Thanks for the answer. I’ll try to tackle this as soon I have time for that.  
Petr

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [May 30, 2017, 10:26pm UTC](https://discourse.julialang.org/t/axisarray-plotted-by-plots-jl/3972/4 "2017-05-30T22:26:10Z")

</div>

I think this already works in ImageView. Of course you don’t get the lovely axes and other features of Plots.

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [November 27, 2017, 1:54pm UTC](https://discourse.julialang.org/t/axisarray-plotted-by-plots-jl/3972/5 "2017-11-27T13:54:28Z")

</div>

Any headway on this?  
I filed an [issue](https://github.com/JuliaPlots/Plots.jl/issues/1263) regarding plotting images.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [November 27, 2017, 3:14pm UTC](https://discourse.julialang.org/t/axisarray-plotted-by-plots-jl/3972/6 "2017-11-27T15:14:25Z")

</div>

If there is an easy way to convert that image into a [GMTimage type](https://genericmappingtools.github.io/GMT.jl/latest/types/#Image-type-1) than you could do all you want with GMT.jl. And I would be interested in including the conversion code into the GMT.jl itself.
