'Reset the current Axes, to use a new WCS object.'

def reset_wcs(self, wcs=None, slices=None, transform=None, coord_meta=None):

    if ((wcs is None) and (transform is None)):
        self.wcs = IDENTITY
    else:
        if (wcs is not None):
            wcs.wcs.set()
        self.wcs = wcs
    if hasattr(self, 'coords'):
        previous_frame = {'path': self.coords.frame._path, 'color': self.coords.frame.get_color(), 'linewidth': self.coords.frame.get_linewidth()}
    else:
        previous_frame = {'path': None}
    self.coords = CoordinatesMap(self, wcs=self.wcs, slice=slices, transform=transform, coord_meta=coord_meta, frame_class=self.frame_class, previous_frame_path=previous_frame['path'])
    if (previous_frame['path'] is not None):
        self.coords.frame.set_color(previous_frame['color'])
        self.coords.frame.set_linewidth(previous_frame['linewidth'])
    self._all_coords = [self.coords]
    if (slices is None):
        self.slices = ('x', 'y')
        self._x_index = 0
        self._y_index = 1
    else:
        self.slices = slices
        self._x_index = self.slices.index('x')
        self._y_index = self.slices.index('y')
    if (self.frame_class is RectangularFrame):
        for coord_index in range(len(self.slices)):
            if (self.slices[coord_index] == 'x'):
                self.coords[coord_index].set_axislabel_position('b')
                self.coords[coord_index].set_ticklabel_position('b')
            elif (self.slices[coord_index] == 'y'):
                self.coords[coord_index].set_axislabel_position('l')
                self.coords[coord_index].set_ticklabel_position('l')
            else:
                self.coords[coord_index].set_axislabel_position('')
                self.coords[coord_index].set_ticklabel_position('')
                self.coords[coord_index].set_ticks_position('')
    elif (self.frame_class is EllipticalFrame):
        for coord_index in range(len(self.slices)):
            if (self.slices[coord_index] == 'x'):
                self.coords[coord_index].set_axislabel_position('h')
                self.coords[coord_index].set_ticklabel_position('h')
                self.coords[coord_index].set_ticks_position('h')
            elif (self.slices[coord_index] == 'y'):
                self.coords[coord_index].set_ticks_position('c')
                self.coords[coord_index].set_axislabel_position('c')
                self.coords[coord_index].set_ticklabel_position('c')
            else:
                self.coords[coord_index].set_axislabel_position('')
                self.coords[coord_index].set_ticklabel_position('')
                self.coords[coord_index].set_ticks_position('')
