I encountered a strange error when trying to put some annotations on a graph. I was able to simplify it to this:
pyplot.plot([1, 2, 3, 4], [0, -1, -2, 8])
pyplot.annotate("Blah", xy=(2, 2), xytext=(-20,-20), textcoords='offset points',
On my system (matplotlib 1.1.0 with Python 2.6 on Windows XP), this causes a long traceback culminating in
File "C:\Program Files\Python\lib\site-packages\matplotlib\bezier.py", line 129, in find_bezier_t_intersecting_with_closedpath
raise ValueError("the segment does not seemed to intersect with the path")
Increasing the xytext coordinates (in absolute value), to for instance (-50, -50) works with no error, and it also works without the special bbox style. Just guessing from the error message, it looks like certain combinations of fancy patches are causing problems because the shapes don't intersect in the way the drawing code assumes they should.
I don't see anything in the docs about such edge cases, so this looks like a bug. Judging from the way that small tweaks to the code can cause the error to disappear, I imagine it could be tricky to fix, but at the least there should probably be a warning in the docs that some kinds of anootation boxes won't work with some kinds of arrows when the text is too close to the annotated point.
"Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail."