Skip to content

Commit

Permalink
Merge pull request #1618 from WeatherGod/mplot3d/crashfixes
Browse files Browse the repository at this point in the history
Mplot3d/crashfixes
  • Loading branch information
WeatherGod committed Jan 7, 2013
2 parents 084a94f + 0ce0659 commit 8bdc2c6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/mpl_toolkits/mplot3d/axes3d.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
""" """


import warnings import warnings
from operator import itemgetter

import matplotlib.axes as maxes import matplotlib.axes as maxes
from matplotlib.axes import Axes, rcParams from matplotlib.axes import Axes, rcParams
from matplotlib import cbook from matplotlib import cbook
Expand Down Expand Up @@ -244,16 +246,14 @@ def draw(self, renderer):
# Calculate projection of collections and zorder them # Calculate projection of collections and zorder them
zlist = [(col.do_3d_projection(renderer), col) \ zlist = [(col.do_3d_projection(renderer), col) \
for col in self.collections] for col in self.collections]
zlist.sort() zlist.sort(key=itemgetter(0), reverse=True)
zlist.reverse()
for i, (z, col) in enumerate(zlist): for i, (z, col) in enumerate(zlist):
col.zorder = i col.zorder = i


# Calculate projection of patches and zorder them # Calculate projection of patches and zorder them
zlist = [(patch.do_3d_projection(renderer), patch) \ zlist = [(patch.do_3d_projection(renderer), patch) \
for patch in self.patches] for patch in self.patches]
zlist.sort() zlist.sort(key=itemgetter(0), reverse=True)
zlist.reverse()
for i, (z, patch) in enumerate(zlist): for i, (z, patch) in enumerate(zlist):
patch.zorder = i patch.zorder = i


Expand Down Expand Up @@ -568,7 +568,7 @@ def set_xlim3d(self, left=None, right=None, emit=True, auto=False, **kw):
if kw: if kw:
raise ValueError("unrecognized kwargs: %s" % kw.keys()) raise ValueError("unrecognized kwargs: %s" % kw.keys())


if right is None and iterable(left): if right is None and cbook.iterable(left):
left, right = left left, right = left


self._process_unit_info(xdata=(left, right)) self._process_unit_info(xdata=(left, right))
Expand Down Expand Up @@ -623,7 +623,7 @@ def set_ylim3d(self, bottom=None, top=None, emit=True, auto=False, **kw):
if kw: if kw:
raise ValueError("unrecognized kwargs: %s" % kw.keys()) raise ValueError("unrecognized kwargs: %s" % kw.keys())


if top is None and iterable(bottom): if top is None and cbook.iterable(bottom):
bottom, top = bottom bottom, top = bottom


self._process_unit_info(ydata=(bottom, top)) self._process_unit_info(ydata=(bottom, top))
Expand Down Expand Up @@ -677,7 +677,7 @@ def set_zlim3d(self, bottom=None, top=None, emit=True, auto=False, **kw):
if kw: if kw:
raise ValueError("unrecognized kwargs: %s" % kw.keys()) raise ValueError("unrecognized kwargs: %s" % kw.keys())


if top is None and iterable(bottom): if top is None and cbook.iterable(bottom):
bottom, top = bottom bottom, top = bottom


self._process_unit_info(zdata=(bottom, top)) self._process_unit_info(zdata=(bottom, top))
Expand Down Expand Up @@ -1425,7 +1425,7 @@ def set_zbound(self, lower=None, upper=None):
.. versionadded :: 1.1.0 .. versionadded :: 1.1.0
This function was added, but not tested. Please report any bugs. This function was added, but not tested. Please report any bugs.
""" """
if upper is None and iterable(lower): if upper is None and cbook.iterable(lower):
lower,upper = lower lower,upper = lower


old_lower,old_upper = self.get_zbound() old_lower,old_upper = self.get_zbound()
Expand Down

0 comments on commit 8bdc2c6

Please sign in to comment.