JuliaGraphics / Winston.jl

2D plotting for Julia
MIT License
171 stars 55 forks source link

Using a background image with FramedPlot() #180

Open mszlosser opened 9 years ago

mszlosser commented 9 years ago

using TestImages, Winston

img = testimage("mandrill") p1 = FramedPlot() add(p1, Points(10, 20, color="red")) add(p1, Image(img)) # ??? file(p1, "myImage.png")

nolta commented 9 years ago

This needs better support, but for now:

using Color, TestImages, Winston

img = testimage("mandrill")
p1 = FramedPlot()
rawimg = flipud(convert(Array{UInt32}, convert(Array{RGB24}, img)))
add(p1, Image((0,30), (0,30), rawimg))
add(p1, Points(10, 20, color="red"))