Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1131d05

Browse files
committed
Mplot3d: fix scatter3d markers bug
svn path=/branches/v0_99_maint/; revision=8016
1 parent 80451bc commit 1131d05

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ class Patch3DCollection(PatchCollection):
240240

241241
def __init__(self, *args, **kwargs):
242242
PatchCollection.__init__(self, *args, **kwargs)
243+
self._old_draw = lambda x: PatchCollection.draw(self, x)
243244

244245
def set_3d_properties(self, zs, zdir):
245246
xs, ys = zip(*self.get_offsets())
@@ -259,10 +260,15 @@ def do_3d_projection(self, renderer):
259260
return min(vzs)
260261

261262
def draw(self, renderer):
262-
PatchCollection.draw(self, renderer)
263+
self._old_draw(renderer)
263264

264265
def patch_collection_2d_to_3d(col, zs=0, zdir='z'):
265266
"""Convert a PatchCollection to a Patch3DCollection object."""
267+
268+
# The tricky part here is that there are several classes that are
269+
# derived from PatchCollection. We need to use the right draw method.
270+
col._old_draw = col.draw
271+
266272
col.__class__ = Patch3DCollection
267273
col.set_3d_properties(zs, zdir)
268274

0 commit comments

Comments
 (0)