Fixed 'Axes' object has no attribute 'get_frame' error (see http://matplotlib.org/api/api_changes.html)

This commit is contained in:
J.L. Cercos-Pita 2015-05-31 19:28:16 +02:00
parent 2e14552a50
commit 071829dbc9

View File

@ -192,7 +192,10 @@ def legend(status=True, pos=None, fontsize=None):
# Update canvas in order to compute legend data
plt.canvas.draw()
# Get resultant position
fax = axes.get_frame().get_extents()
try:
fax = axes.get_frame().get_extents()
except:
fax = axes.patch.get_extents()
fl = l.get_frame()
plt.legPos = (
(fl._x + fl._width - fax.x0) / fax.width,