In [2]:
import matplotlib.pyplot as plt
axes = plt.axes()
axes.arrow(0.0, 0.0, 1.0, 1.0, head_width=0.1, head_length=0.1)
axes.set_xlim([-0.5, 1.5])
axes.set_ylim([-0.5, 1.5])
line = plt.plot([1.0, 1.0], [0.0, 1.0])
plt.setp(line, ls='-', color='r', linewidth=0.75, label='y')
line = plt.plot([0.0, 1.0], [0.0, 0.0])
plt.setp(line, ls='-', color='b', linewidth=0.75, label='x')
plt.title('Simple 2D Vector')
plt.ylabel('y coordinates')
plt.xlabel('x coordinates')
plt.grid(True, linestyle=':')
plt.legend()
plt.show()
In [ ]: