def METHOD_NAME(self, x_min, x_max, y_min, y_max, max_x_range, max_y_range):
    """Update the axis range of the plot
    :param x_min: the minimum x value
    :param x_max: the maximum x value
    :param y_min: the minimum y value
    :param y_max: the maximum y value
    :param max_x_range: field.max_x_range from field.py
    :param max_y_range: field.max_y_range from field.py
    """
    if self.cached_cost_vis.num_cols != 0 and self.cached_cost_vis.num_rows != 0:
        # convert from field coordinates to image coordinates
        x_min = np.interp(
            x_min,
            [-max_x_range / 2, max_x_range / 2],
            [0, self.cached_cost_vis.num_cols],
        )
        x_max = np.interp(
            x_max,
            [-max_x_range / 2, max_x_range / 2],
            [0, self.cached_cost_vis.num_cols],
        )
        y_min = np.interp(
            y_min,
            [-max_y_range / 2, max_y_range / 2],
            [0, self.cached_cost_vis.num_rows],
        )
        y_max = np.interp(
            y_max,
            [-max_y_range / 2, max_y_range / 2],
            [0, self.cached_cost_vis.num_rows],
        )
        self.view_box.setRange(xRange=(x_min, x_max), yRange=(y_min, y_max))
        self.prev_num_rows = self.cached_cost_vis.num_rows