finesse.plotting.plot.add_arrow

finesse.plotting.plot.add_arrow(line, position=None, direction='right', size=15, color=None)[source]

Add an arrow to a line.

Parameters
lineLine2D object

The line to which the arrow will be added.

positionfloat or iterable[float], optional

The x-position of the arrow. If None, the mean of xdata is taken. should be fractional of line x range, 0.5 is in the middle.

direction{‘left’, ‘right’}, optional

The direction of the arrow. Default is ‘right’.

sizeint, optional

The size of the arrow in fontsize points. Default is 15.

colorstr, optional

The color of the arrow. If None, the line color is taken.

Notes

This function adds an arrow to a line plot using the matplotlib library.

References

Examples

>>> import matplotlib.pyplot as plt
>>> line, = plt.plot(np.linspace(0, 1), np.linspace(10, -10))
>>> add_arrow(line, [0, 0.5, 1])