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

Skip to content

slow_update #548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
support animated property on figure elements
  • Loading branch information
jdh2358 committed Oct 15, 2011
commit 2438af2bae0a9e723d780da9d94e5fad41f7a46b
19 changes: 10 additions & 9 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,13 +827,13 @@ def draw(self, renderer):
dsu = []

for a in self.patches:
dsu.append( (a.get_zorder(), a.draw, [renderer]))
dsu.append( (a.get_zorder(), a, a.draw, [renderer]))

for a in self.lines:
dsu.append( (a.get_zorder(), a.draw, [renderer]))
dsu.append( (a.get_zorder(), a, a.draw, [renderer]))

for a in self.artists:
dsu.append( (a.get_zorder(), a.draw, [renderer]))
dsu.append( (a.get_zorder(), a, a.draw, [renderer]))

# override the renderer default if self.suppressComposite
# is not None
Expand All @@ -844,7 +844,7 @@ def draw(self, renderer):
if len(self.images)<=1 or not_composite or \
not allequal([im.origin for im in self.images]):
for a in self.images:
dsu.append( (a.get_zorder(), a.draw, [renderer]))
dsu.append( (a.get_zorder(), a, a.draw, [renderer]))
else:
# make a composite image blending alpha
# list of (_image.Image, ox, oy)
Expand All @@ -866,21 +866,22 @@ def draw_composite():
renderer.draw_image(gc, l, b, im)
gc.restore()

dsu.append((self.images[0].get_zorder(), draw_composite, []))
dsu.append((self.images[0].get_zorder(), self.images[0], draw_composite, []))

# render the axes
for a in self.axes:
dsu.append( (a.get_zorder(), a.draw, [renderer]))
dsu.append( (a.get_zorder(), a, a.draw, [renderer]))

# render the figure text
for a in self.texts:
dsu.append( (a.get_zorder(), a.draw, [renderer]))
dsu.append( (a.get_zorder(), a, a.draw, [renderer]))

for a in self.legends:
dsu.append( (a.get_zorder(), a.draw, [renderer]))
dsu.append( (a.get_zorder(), a, a.draw, [renderer]))

dsu = [row for row in dsu if not row[1].get_animated()]
dsu.sort(key=itemgetter(0))
for zorder, func, args in dsu:
for zorder, a, func, args in dsu:
func(*args)

renderer.close_group('figure')
Expand Down