code: def switch_axis_limits(ax, which_axis):
      '''
      Switch the axis limits of either x or y. Or both!
      '''
      for a in which_axis:
          assert a in ('x', 'y')
          ax_limits = ax.axis()
          if a == 'x':
              ax.set_xlim(ax_limits[1], ax_limits[0])
          else:
              ax.set_ylim(ax_limits[3], ax_limits[2]f switch_axis_limits(ax, which_axis):
      '''
      Switch the axis limits of either x or y. Or both!
      '''
      for a in which_axis:
          assert a in ('x', 'y')
          ax_limits = ax.axis()
          if a == 'x':
              ax.set_xlim(ax_limits[1], ax_limits[0])
          else:
              ax.set_ylim(ax_limits[3], ax_limits[2])
docs: Switch the axis limits of either x or y. Or both!