class_docstr: Line segments
  
  {usage}
  
  Parameters
  ----------
  {common_parameters}
  lineend : Literal["butt", "round", "projecting"], default="butt"
      Line end style. This option is applied for solid linetypes.
  arrow : ~plotnine.geoms.geom_path.arrow, default=None
      Arrow specification. Default is no arrow.
  
  See Also
  --------
  plotnine.geoms.geom_path.arrow : for adding arrowhead(s) to segments.
class_docstr_tok: ["Line","segments","{","usage","}","Parameters","--","--","--","--","--","{","common_parameters","}","lineend",":","Literal","[","``","butt","''",",","``","round","''",",","``","projecting","''","]",",","default=","''","butt","''","Line","end","style",".","This","option","is","applied","for","solid","linetypes",".","arrow",":","~plotnine.geoms.geom_path.arrow",",","default=None","Arrow","specification",".","Default","is","no","arrow",".","See","Also","--","--","--","--","plotnine.geoms.geom_path.arrow",":","for","adding","arrowhead","(","s",")","to","segments","."]
code: def draw_group(
      data: pd.DataFrame,
      panel_params: panel_view,
      coord: Coord,
      ax: Axes,
      **params: Any,
  ):
      from matplotlib.collections import LineCollection
  
      data = coord.transform(data, panel_params)
      data["size"] *= SIZE_FACTOR
      color = to_rgba(data["color"], data["alpha"])
  
      # start point -> end point, sequence of xy points
      # from which line segments are created
      x = interleave(data["x"], data["xend"])
      y = interleave(data["y"], data["yend"])
      segments = make_line_segments(x, y, ispath=False)
      coll = LineCollection(
          list(segments),
          edgecolor=color,
          linewidth=data["size"],
          linestyle=data["linetype"][0],
          zorder=params["zorder"],
          rasterized=params["raster"],
      )
      ax.add_collection(coll)
  
      if "arrow" in params and params["arrow"]:
          adata = pd.DataFrame(index=range(len(data) * 2))
          idx = np.arange(1, len(data) + 1)
          adata["group"] = np.hstack([idx, idx])
          adata["x"] = np.hstack([data["x"], data["xend"]])
          adata["y"] = np.hstack([data["y"], data["yend"]])
          other = ["color", "alpha", "size", "linetype"]
          for param in other:
              adata[param] = np.hstack([data[param], data[param]])
  
          params["arrow"].draw(
              adata, panel_params, coord, ax, constant=False, **params
          )
  
file_path: plotnine/plotnine/geoms/geom_segment.py
imports: from __future__ import annotations
  import typing
  import numpy
  import pandas
  from .._utils import SIZE_FACTOR, interleave, make_line_segments, to_rgba
  from ..doctools import document
  from .geom import geom
  from .geom_path import geom_path
label_desc: Use image node_id 1 for calling the geom_segment obj's underlying member method code with example usage: obj.draw_group(data, panel_params, coord, ax) without return types