@@ -623,8 +623,11 @@ def set_xlim3d(self, left=None, right=None, emit=True, auto=False,
623623 cbook ._warn_external (
624624 f"Attempting to set identical left == right == { left } results "
625625 f"in singular transformations; automatically expanding." )
626+ swapped = left > right
626627 left , right = self .xaxis .get_major_locator ().nonsingular (left , right )
627628 left , right = self .xaxis .limit_range_for_scale (left , right )
629+ if swapped :
630+ left , right = right , left
628631 self .xy_viewLim .intervalx = (left , right )
629632
630633 if auto is not None :
@@ -681,8 +684,11 @@ def set_ylim3d(self, bottom=None, top=None, emit=True, auto=False,
681684 f"Attempting to set identical bottom == top == { bottom } "
682685 f"results in singular transformations; automatically "
683686 f"expanding." )
687+ swapped = bottom > top
684688 bottom , top = self .yaxis .get_major_locator ().nonsingular (bottom , top )
685689 bottom , top = self .yaxis .limit_range_for_scale (bottom , top )
690+ if swapped :
691+ bottom , top = top , bottom
686692 self .xy_viewLim .intervaly = (bottom , top )
687693
688694 if auto is not None :
@@ -739,8 +745,11 @@ def set_zlim3d(self, bottom=None, top=None, emit=True, auto=False,
739745 f"Attempting to set identical bottom == top == { bottom } "
740746 f"results in singular transformations; automatically "
741747 f"expanding." )
748+ swapped = bottom > top
742749 bottom , top = self .zaxis .get_major_locator ().nonsingular (bottom , top )
743750 bottom , top = self .zaxis .limit_range_for_scale (bottom , top )
751+ if swapped :
752+ bottom , top = top , bottom
744753 self .zz_viewLim .intervalx = (bottom , top )
745754
746755 if auto is not None :
0 commit comments