From b725f473e19dde853883b9ce2ab4de58c537879e Mon Sep 17 00:00:00 2001 From: Jeremy Fix Date: Thu, 4 Jun 2015 18:34:35 +0200 Subject: [PATCH] Returning the Poly3DCollection when calling bar3d bar3d does not return the Poly3DCollection which is annoying if one wishes to update the bar plot; Without the modification, I feel I have to do : ax.bar3d( ...) col = ax.collections[-1] And then for animating : While(True): col.remove() ax.bar3d(...) col = ax.collections[-1] with the modification, I can merge the ax.bar3d(..); col = .. ; as col = ax.bar3d(...) --- lib/mpl_toolkits/mplot3d/axes3d.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py index 3881370beab7..caaf1ccf84cb 100755 --- a/lib/mpl_toolkits/mplot3d/axes3d.py +++ b/lib/mpl_toolkits/mplot3d/axes3d.py @@ -2427,6 +2427,8 @@ def bar3d(self, x, y, z, dx, dy, dz, color='b', self.add_collection(col) self.auto_scale_xyz((minx, maxx), (miny, maxy), (minz, maxz), had_data) + + return col def set_title(self, label, fontdict=None, loc='center', **kwargs): ret = Axes.set_title(self, label, fontdict=fontdict, loc=loc, **kwargs)