 # Arrows in plots

Dear Matplotlib-Users,

I would like to add arrows at the corners of the
blue line to illustrate the order of the
iterates. Is it possible to realize it with
matplotlib ?

Nils Some time ago (before the arrow patch), I wrote a small function to do this. I hope that this is also useful for you.

···

---------------------------
def arrow(p1, p2, style=None, linewidth=1):
import math
import pylab as P
linex = [p1, p2]
liney = [p1, p2]
theta0 = math.atan2(liney-liney, linex-linex)
thetaa = math.pi/12
theta1 = theta0 - thetaa
theta2 = theta0 + thetaa
L = 0.05
xh = linex
yh = liney
xa1 = xh - L*math.cos(theta1)
ya1 = yh - L*math.sin(theta1)
xa2 = xh - L*math.cos(theta2)
ya2 = yh - L*math.sin(theta2)
P.plot(linex, liney, style, linewidth=linewidth)
P.plot([xa1, xh, xa2], [ya1, yh, ya2], 'k-', linewidth=linewidth)
---------------------------
Nils Wagner wrote:

Dear Matplotlib-Users,

I would like to add arrows at the corners of the
blue line to illustrate the order of the
iterates. Is it possible to realize it with
matplotlib ?

Nils

------------------------------------------------------------------------