Quiver plot (Plots.pyplot) with different colors depending on the length of the arrow

I didn’t completely understand what’s going on with the inner= -part. But I tried to understand the code example from the link above. I did the following:

Blockquote

Arrow position.

x = collect(0:10) # we have 11 points, not 10 !
y = fill(0., 10)

Arrow direction.

u = fill(1., 10)
v = fill(10., 10) # I think the (1,10) here was a typo

Arrow color.

c = collect(1:11) # or 0:10, but not 1:10
plt = quiver(x, y, quiver=(u, v), line_z=c, c=:viridis)
display(plt)

Blockquote

and I get:


I gave my example another try with as many lengths as arrows. And it worked out after all ! Now I only have to change the sombreros. But I’m already delighted. I couldn’t have done that without your help!

1 Like