class_docstr: An oriented line mark drawn between min/max values.
  
  Examples
  --------
  .. include:: ../docstrings/objects.Range.rst
class_docstr_tok: ["An","oriented","line","mark","drawn","between","min\/max","values",".","Examples","--","--","--","--","..","include",":",":","..","\/docstrings\/objects.Range.rst"]
code: def _setup_segments(self, data, orient):
      # TODO better checks on what variables we have
      # TODO what if only one exist?
      val = {"x": "y", "y": "x"}[orient]
      if not set(data.columns) & {f"{val}min", f"{val}max"}:
          agg = {f"{val}min": (val, "min"), f"{val}max": (val, "max")}
          data = data.groupby(orient).agg(**agg).reset_index()
  
      cols = [orient, f"{val}min", f"{val}max"]
      data = data[cols].melt(orient, value_name=val)[["x", "y"]]
      segments = [d.to_numpy() for _, d in data.groupby(orient)]
      return segments
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import ClassVar
  import numpy
  import matplotlib
  from seaborn._marks.base import Mark, Mappable, MappableFloat, MappableString, MappableColor, resolve_properties, resolve_color, document_properties
label_desc: Use image node_id 1 for calling the Range obj's underlying member method code with example usage: obj._setup_segments(data, orient) and returns: segments