问题
I want using Plots.jl for plot on Images, for example simple sinusoid. Here my code:
using Plots
using Images
gr()
h = 400
w = 600
a = Array(RGB{FixedPointNumbers.UFixed{UInt8,8}}, h, w)
img = Image(a)
p=plot(img)
x = collect(0:0.1:2π)
plot!(x,sin(x))
png("Test")
But I get wrong result. How do this correctly?
回答1:
Here's a quick example that I hope gives you some clues:
julia> plot(img)
julia> plot!(x->200sin(.05x)+300, 0, 700, w=5)
You probably just want to ensure that you're plotting to the right coordinates that match the image.
来源:https://stackoverflow.com/questions/41704558/how-plot-on-images-with-plots-jl