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

Skip to content

Commit 3493883

Browse files
committed
zorder support in figure: use same sort idiom as in axes
svn path=/trunk/matplotlib/; revision=8049
1 parent a5761e8 commit 3493883

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lib/matplotlib/figure.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import matplotlib.cbook as cbook
3434
from matplotlib import docstring
3535

36+
from operator import itemgetter
37+
3638
docstring.interpd.update(projection_names = get_projection_names())
3739

3840
class SubplotParams:
@@ -742,8 +744,6 @@ def draw(self, renderer):
742744
# a list of (zorder, func_to_call, list_of_args)
743745
dsu = []
744746

745-
746-
# todo: respect zorder
747747
for a in self.patches:
748748
dsu.append( (a.get_zorder(), a.draw, [renderer]))
749749

@@ -797,8 +797,7 @@ def draw_composite():
797797
for a in self.legends:
798798
dsu.append( (a.get_zorder(), a.draw, [renderer]))
799799

800-
801-
dsu.sort(key=lambda x: x[0])
800+
dsu.sort(key=itemgetter(0))
802801
for zorder, func, args in dsu:
803802
func(*args)
804803

0 commit comments

Comments
 (0)