I am trying to overlay a basic plot onto an image. It is not clear based on the Julia Docs: http://docs.juliaplots.org/latest/examples/pyplot/
How can I plot on an image? Here is my code in Julia:
using Plots
x_coordinate_holder = [30515.4, 30515.4, 30490.9, 30470.7, 30470.7, 30450.9, 30450.0,
30450.0, 30450.0, 30450.0, 30450.0, 30430.8, 30449.2, 30469.4,
30469.4, 30469.4, 30489.2, 30489.2, 30489.2, 30509.4, 30529.1,
30549.4, 30569.2, 30589.3, 30590.0, 30609.2, 30610.0, 30610.0,
30590.7, 30590.7, 30590.7, 30570.8, 30570.0, 30570.0, 30589.4,
30589.4, 30589.4, 30590.0, 30570.6, 30550.8, 30569.2, 30569.2,
30589.4, 30589.4, 30570.6, 30570.6, 30570.6, 30570.6, 30550.8,
30530.6, 30510.8, 30510.0, 30510.0, 30529.3, 30549.1, 30549.1,
30569.3, 30570.0, 30589.3, 30590.0, 30590.0, 30590.0, 30609.3,
30610.0, 30610.0, 30610.0, 30629.2, 30649.4, 30669.2, 30689.4,
30709.2, 30710.0, 30710.0]
y_coordinate_holder = [14186.3, 14186.3, 14209.2, 14229.3, 14229.3, 14249.1, 14269.3,
14269.3, 14269.3, 14269.3, 14269.3, 14289.1, 14290.0, 14290.0,
14290.0, 14290.0, 14309.2, 14309.2, 14309.2, 14329.4, 14330.0,
14349.4, 14369.2, 14389.3, 14370.5, 14350.8, 14330.6, 14330.6,
14330.0, 14330.0, 14330.0, 14349.2, 14330.8, 14330.8, 14310.6,
14310.6, 14310.6, 14290.8, 14270.6, 14270.0, 14270.0, 14270.0,
14270.0, 14270.0, 14270.0, 14270.0, 14270.0, 14270.0, 14270.0,
14250.6, 14250.0, 14230.7, 14249.1, 14230.7, 14210.9, 14210.9,
14190.7, 14209.1, 14190.7, 14209.5, 14209.5, 14209.5, 14210.0,
14229.3, 14210.9, 14190.7, 14209.2, 14210.0, 14190.8, 14190.0,
14190.0, 14209.3, 14209.3]
plotly()
plot(x_coordinate_holder, y_coordinate_holder, color = :blue, linewidth=2)
gui()
Note: I looked at How plot on Images with Plots.jl?
This example doesn't work anymore which is why I am asking the question again. Here is my updated code.
plotly()
img = Image("/path/to/image/file/exmaple/test.png)
plot(img)
plot!(x_coordinate_holder, y_coordinate_holder, color = :blue, linewidth=2)
gui() #Should open up a browser window/tab and show the plot in there.
When running this I get the following error:
* **ERROR: LoadError: UndefVarError: Image not defined** *
Can anyone provide a complete example?
Images
package and see here: stackoverflow.com/questions/41704558/… It should work with plotly backend as well, albeit a bit slowly. – hckrImage
package? I have tried the solution there before flagging duplicate. Also make sure you import the packageusing Images
. – hckr