docstr: Draw a rugplot along one axis of the plot.
docstr_tok: ["Draw","a","rugplot","along","one","axis","of","the","plot","."]
code: def _plot_single_rug(self, sub_data, var, height, ax, kws):
      """Draw a rugplot along one axis of the plot."""
      vector = sub_data[var]
      n = len(vector)
  
      # Return data to linear domain
      _, inv = _get_transform_functions(ax, var)
      vector = inv(vector)
  
      # We'll always add a single collection with varying colors
      if "hue" in self.variables:
          colors = self._hue_map(sub_data["hue"])
      else:
          colors = None
  
      # Build the array of values for the LineCollection
      if var == "x":
          trans = tx.blended_transform_factory(
              ax.transData, ax.transAxes
          )
          xy_pairs = np.column_stack(
              [np.repeat(vector, 2), np.tile([0, height], n)]
          )
  
      if var == "y":
          trans = tx.blended_transform_factory(
              ax.transAxes, ax.transData
          )
          xy_pairs = np.column_stack(
              [np.tile([0, height], n), np.repeat(vector, 2)]
          )
  
      # Draw the lines on the plot
      line_segs = xy_pairs.reshape([n, 2, 2])
      ax.add_collection(
          LineCollection(
              line_segs, transform=trans, colors=colors, **kws
          )
      )
  
      ax.autoscale_view(scalex=var == "x", scaley=var == "y")
  
imports: from numbers import Number
  from functools import partial
  import math
  import textwrap
  import warnings
  import numpy
  import pandas
  import matplotlib
  import matplotlib.pyplot
  import matplotlib.transforms
  from matplotlib.cbook import normalize_kwargs
  from matplotlib.colors import to_rgba
  from matplotlib.collections import LineCollection
  from ._base import VectorPlotter
  from ._statistics import ECDF, Histogram, KDE
  from ._stats.counting import Hist
  from .axisgrid import FacetGrid, _facet_docs
  from .utils import remove_na, _get_transform_functions, _kde_support, _check_argument, _assign_default_kwargs, _default_color
  from .palettes import color_palette
  from .external import husl
  from .external.kde import gaussian_kde
  from ._docstrings import DocstringComponents, _core_docs
label_desc: Use image node_id 18 for calling the _DistributionPlotter obj's underlying member method code with example usage: obj._plot_single_rug(sub_data, var, height, ax, kws) without return types