Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Closes issue #1595 - sorting on a list of tuples can sometimes cause …

…crashes
  • Loading branch information...
commit 0ce06597b51ba38263e69582e2b9ec7fc76a1424 1 parent 10d5d6e
Benjamin Root WeatherGod authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/mpl_toolkits/mplot3d/axes3d.py
8 lib/mpl_toolkits/mplot3d/axes3d.py
View
@@ -11,6 +11,8 @@
"""
import warnings
+from operator import itemgetter
+
import matplotlib.axes as maxes
from matplotlib.axes import Axes, rcParams
from matplotlib import cbook
@@ -244,16 +246,14 @@ def draw(self, renderer):
# Calculate projection of collections and zorder them
zlist = [(col.do_3d_projection(renderer), col) \
for col in self.collections]
- zlist.sort()
- zlist.reverse()
+ zlist.sort(key=itemgetter(0), reverse=True)
for i, (z, col) in enumerate(zlist):
col.zorder = i
# Calculate projection of patches and zorder them
zlist = [(patch.do_3d_projection(renderer), patch) \
for patch in self.patches]
- zlist.sort()
- zlist.reverse()
+ zlist.sort(key=itemgetter(0), reverse=True)
for i, (z, patch) in enumerate(zlist):
patch.zorder = i
Please sign in to comment.
Something went wrong with that request. Please try again.