cphyc / matplotlib-label-lines

Label line using matplotlib.
MIT License
301 stars 28 forks source link

Doesn't work with Matplotlib 2.1.0+ due to get_axes() removal #1

Closed dark-saber closed 6 years ago

dark-saber commented 6 years ago

Unfortunately, the code is now broken, because previously deprecated get_axes method was removed in Matplotlib 2.1.0.

python2 ./trend1.py
Traceback (most recent call last):
  File "./trend1.py", line 20, in <module>
    labelLines(plt.gca().get_lines(),zorder=2.5)
  File "/usr/lib/python2.7/site-packages/labellines/core.py", line 78, in labelLines
    ax = lines[0].get_axes()
AttributeError: 'Line2D' object has no attribute 'get_axes'
cphyc commented 6 years ago

Thanks for the feedback. It should be fixed it in version 0.3.1 (see commit https://github.com/cphyc/matplotlib-label-lines/commit/9288ba88e16547ac71b949902347993a924facad). Please update your installation. If the problem persists, don't hesitate to reopen the issue.

If have tested the new version against Matplotlib 2.1.1.