I found a rare behaviour in matplotlib when trying to plot arrows. If you make a figure as below:
import matplotlib.pyplot as plt
import matplotlib.patches as patches
arrow = patches.FancyArrow(0.,0.,0.4,0.6)
fig = plt.figure(1)
ax1 = fig.add_subplot(121)
ax2 = fig.add_subplot(122)
ax1.add_line(arrow)
plt.show()
you will see the arrow perfectly in the first axis. But when trying to add the same arrow on the second axis:
import matplotlib.pyplot as plt
import matplotlib.patches as patches
arrow = patches.FancyArrow(0.,0.,0.4,0.6)
fig = plt.figure(1)
ax1 = fig.add_subplot(121)
ax2 = fig.add_subplot(122)
ax1.add_line(arrow)
ax2.add_line(arrow)
plt.show()
you are going to note that the arrows are not plotted.
If we try to make the same figure, but now with different copies of the arrow object:
import matplotlib.pyplot as plt
import matplotlib.patches as patches
arrow1 = patches.FancyArrow(0.,0.,0.4,0.6)
arrow2 = patches.FancyArrow(0.,0.,0.4,0.6)
fig = plt.figure(1)
ax1 = fig.add_subplot(121)
ax2 = fig.add_subplot(122)
ax1.add_line(arrow1)
ax2.add_line(arrow2)
plt.show()
It is possible to see both arrows, one in each panel. So, it seems that there is a dependence between different methods and objects. Someone knows what is going on here? Is FancyArrow buggy? Thanks.