HOME/Articles/

matplotlib example arrow (snippet)

Article Outline

Python matplotlib example 'arrow'

Modules used in program:

  • import matplotlib.pyplot as plt

python arrow

Python matplotlib example: arrow

import matplotlib.pyplot as plt
from matplotlib.patches import Arrow

plt.figure(1, figsize=(3,3))
ax = plt.gca()

ax.annotate("",
            xy=(0.2, 0.2), xycoords='data',
            xytext=(0.8, 0.8), textcoords='data',
            arrowprops=dict(arrowstyle="->",
                            connectionstyle="arc3"), 
            )

plt.arrow(0,0,0.5,0.7, shape='full', lw=1, length_includes_head=True, head_width=.02)

plt.show()