AxisArray plotted by Plots.jl

plotting

#1

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

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


#2

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.


#3

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


#4

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


#5

Any headway on this?
I filed an issue regarding plotting images.


#6

If there is an easy way to convert that image into a GMTimage type 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.