Closed
Description
The following code produces no plot:
%pylab inline
from matplotlib.patches import ConnectionPatch
xy1 = (0.3, 0.3)
xy2 = (0.3, 0.3)
ax = gca()
con = ConnectionPatch(xyA=xy1, xyB=xy2, coordsA="data", coordsB="data",
arrowstyle='fancy', # <-- this is ok
axesA=ax, axesB=ax)
ax.add_artist(con)
It works fine if I change the arrowstyle to the default.
With arrowstyle='fancy', I get the following warnings:
/usr/local/lib/python2.7/dist-packages/matplotlib/patches.py:2960: RuntimeWarning: divide by zero encountered in double_scalars
ff = d / (dx * dx + dy * dy) ** .5
/usr/local/lib/python2.7/dist-packages/matplotlib/patches.py:2961: RuntimeWarning: invalid value encountered in double_scalars
x2, y2 = x0 - ff * dx, y0 - ff * dy
The problem is probably with FancyArrow:
%pylab inline
from matplotlib.patches import FancyArrow, FancyArrowPatch, Arrow
# Arrow is OKAY
p = Arrow(0.3, 0.3, 0, 0)
gca().add_patch(p)
# FancyArrow gives a RuntimeWarning about invalid values. (likely division by zero)
p = FancyArrow(0.3, 0.3, 0, 0)
gca().add_patch(p)
running matplotlib 1.4.2