class_docstr: Data aggregation functionality for ``go.Figures``.
class_docstr_tok: ["Data","aggregation","functionality","for","``","go.Figures","``","."]
code: def _remove_other_axes_for_coarse(self) -> go.Figure:
      # base case: no rows and cols to filter
      if self._grid_ref is None:  # case: go.Figure (no subplots)
          return self
  
      # Create the grid specification for the overview figure (in `reduced_grid_ref`)
      # The trace_list and the 2 axis lists are 1D arrays holding track of the traces
      # and axes to track.
      reduced_grid_ref = [[]]
  
      # Store the xaxis keys (e.g., x2) of the traces to keep
      trace_list = []
      # Store the xaxis and yaxis layout keys of the traces to keep (e.g., xaxis2)
      layout_xaxis_list, layout_yaxis_list = [], []
      for col_idx, row_idx in enumerate(self._overview_row_idxs):
          if row_idx is None:  # skip None value
              continue
  
          overview_grid_ref = self._grid_ref[row_idx][col_idx]
          reduced_grid_ref[0].append(
              overview_grid_ref
          )  # [0] bc 1 row in overview
          for subplot in overview_grid_ref:
              trace_list.append(subplot.trace_kwargs["xaxis"])
  
              # store the layout keys so that we can retain the exact layout
              xaxis_key, yaxis_key = subplot.layout_keys
              layout_yaxis_list.append(yaxis_key)
              layout_xaxis_list.append(xaxis_key)
      # print("layout_list", l_xaxis_list, l_yaxis_list)
      # print("trace_list", trace_list)
  
      fig_dict = (
          self._get_current_graph()
      )  # a copy of the current graph
  
      # copy the data from the relevant overview subplots
      reduced_fig_dict = {
          "data": [],
          "layout": {"template": fig_dict["layout"]["template"]},
      }
      # NOTE: we enumerate over the data of the full figure so that we can utilize the
      # trace index to mimic the colorway.
      for i, trace in enumerate(fig_dict["data"]):
          # NOTE: the interplay between line_color and marker_color seems to work in
          # this implementation - a more thorough investigation might be needed
          if trace.get("xaxis", "x") in trace_list:
              if "line" not in trace:
                  trace["line"] = {}
              # Ensure that the same color is utilized
              trace["line"]["color"] = (
                  self._layout_obj.template.layout.colorway[i]
                  if self.data[i].line.color is None
                  else self.data[i].line.color
              )
              # add the trace to the reduced figure
              reduced_fig_dict["data"].append(trace)
  
      # Add the relevant layout keys to the reduced figure
      for k, v in fig_dict["layout"].items():
          if k in layout_xaxis_list:
              reduced_fig_dict["layout"][k] = v
          elif k in layout_yaxis_list:
              v = v.copy()
              # set the domain to [0, 1] to ensure that the overview figure has the
              # global y-axis range
              v.update({"domain": [0, 1]})
              reduced_fig_dict["layout"][k] = v
  
      # Create a figure object using the reduced figure dict
      reduced_fig = go.Figure(layout=reduced_fig_dict["layout"])
      reduced_fig._grid_ref = reduced_grid_ref
      # Ensure that the trace uid is not adjusted, this must be set prior to adding
      # the trace data. Otherwise, data aggregation will not work.
      reduced_fig._data_validator.set_uid = False
      reduced_fig.add_traces(reduced_fig_dict["data"])
      return reduced_fig
  
imports: from __future__ import annotations
  import os
  import warnings
  from pathlib import Path
  from typing import List, Optional, Tuple
  import dash
  import plotly.graph_objects
  from plotly.basedatatypes import BaseFigure
  from ..aggregation import AbstractAggregator, AbstractGapHandler, MedDiffGapHandler, MinMaxLTTB
  from .figure_resampler_interface import AbstractFigureAggregator
  from .utils import is_figure, is_fr
label_desc: Use image node_id 4 for calling the FigureResampler obj's underlying member method code with example usage: obj._remove_other_axes_for_coarse() and returns: reduced_fig, self