Got two plots when using quiver to draw arrows in Julia

84 views Asked by At

I'm new to Julia. I was trying to draw arrows starting from [X[i], Y[i]], and points to the direction of [VX[i], VY[i]]. However, I'm getting the arrows I wanted, but also other few lines which seem to be the mirror of the arrows. Why is this happening?

Here's the code snippet and the result I get.
I guess it has something to do with the y-axis. But I don't understand very well about the mechanism of quiver in Julia. Could someone explain a little bit about it and show me what is the right way to remove those straight lines?
Thank you!

Using Plots
X = [2, 10, 12, 20, 22, 30]
Y = [2, 10, 12, 20, 22, 30]
VX = [2, 8, 2, 8, 2, 8]
VY = [2, 8, 2, 8, 2, 8]
white_img = fill(Gray(1.0), 50, 50)
plot(white_img)
quiver!(X,Y,quiver=(VX,VY))

Plot result here

0

There are 0 answers