parameters: (self)
docstring: Change self._A and _extent to render an image whose resolution is
          matched to the eventual rendering.
docstring_summary: Change self._A and _extent to render an image whose resolution is
          matched to the eventual rendering.
docstring_tokens: Change self . _A and _extent to render an image whose resolution is matched to the eventual rendering .
function: def _scale_to_res(self):
          """
          Change self._A and _extent to render an image whose resolution is
          matched to the eventual rendering.
          """
  
          # Find out how we need to slice the array to make sure we match the
          # resolution of the display. We pass self._world2pixel which matters
          # for cases where the extent has been set.
          x0, x1, sx, y0, y1, sy = extract_matched_slices(axes=self.axes,
                                                          shape=self._full_res.shape,
                                                          transform=self._world2pixel)
  
          # Check whether we've already calculated what we need, and if so just
          # return without doing anything further.
          if (self._bounds is not None
                  and sx >= self._sx and sy >= self._sy
                  and x0 >= self._bounds[0] and x1 <= self._bounds[1]
                  and y0 >= self._bounds[2] and y1 <= self._bounds[3]):
              return
  
          # Slice the array using the slices determined previously to optimally
          # match the display
          self._A = self._full_res[y0:y1:sy, x0:x1:sx]
          self._A = cbook.safe_masked_invalid(self._A)
  
          # We now determine the extent of the subset of the image, by determining
          # it first in pixel space, and converting it to the 'world' coordinates.
  
          # See https://github.com/matplotlib/matplotlib/issues/8693 for a
          # demonstration of why origin='upper' and extent=None needs to be
          # special-cased.
  
          if self.origin == 'upper' and self._full_extent is None:
              xmin, xmax, ymin, ymax = x0 - .5, x1 - .5, y1 - .5, y0 - .5
          else:
              xmin, xmax, ymin, ymax = x0 - .5, x1 - .5, y0 - .5, y1 - .5
  
          xmin, ymin, xmax, ymax = self._pixel2world.transform([(xmin, ymin), (xmax, ymax)]).ravel()
  
          mi.AxesImage.set_extent(self, [xmin, xmax, ymin, ymax])
          # self.set_extent([xmin, xmax, ymin, ymax])
  
          # Finally, we cache the current settings to avoid re-computing similar
          # arrays in future.
          self._sx = sx
          self._sy = sy
          self._bounds = (x0, x1, y0, y1)
  
          self.changed()
function_tokens: def _scale_to_res ( self ) : # Find out how we need to slice the array to make sure we match the # resolution of the display. We pass self._world2pixel which matters # for cases where the extent has been set. x0 , x1 , sx , y0 , y1 , sy = extract_matched_slices ( axes = self . axes , shape = self . _full_res . shape , transform = self . _world2pixel ) # Check whether we've already calculated what we need, and if so just # return without doing anything further. if ( self . _bounds is not None and sx >= self . _sx and sy >= self . _sy and x0 >= self . _bounds [ 0 ] and x1 <= self . _bounds [ 1 ] and y0 >= self . _bounds [ 2 ] and y1 <= self . _bounds [ 3 ] ) : return # Slice the array using the slices determined previously to optimally # match the display self . _A = self . _full_res [ y0 : y1 : sy , x0 : x1 : sx ] self . _A = cbook . safe_masked_invalid ( self . _A ) # We now determine the extent of the subset of the image, by determining # it first in pixel space, and converting it to the 'world' coordinates. # See https://github.com/matplotlib/matplotlib/issues/8693 for a # demonstration of why origin='upper' and extent=None needs to be # special-cased. if self . origin == 'upper' and self . _full_extent is None : xmin , xmax , ymin , ymax = x0 - .5 , x1 - .5 , y1 - .5 , y0 - .5 else : xmin , xmax , ymin , ymax = x0 - .5 , x1 - .5 , y0 - .5 , y1 - .5 xmin , ymin , xmax , ymax = self . _pixel2world . transform ( [ ( xmin , ymin ) , ( xmax , ymax ) ] ) . ravel ( ) mi . AxesImage . set_extent ( self , [ xmin , xmax , ymin , ymax ] ) # self.set_extent([xmin, xmax, ymin, ymax]) # Finally, we cache the current settings to avoid re-computing similar # arrays in future. self . _sx = sx self . _sy = sy self . _bounds = ( x0 , x1 , y0 , y1 ) self . changed ( )