class_docstr: Interface for creating and using matplotlib subplots based on seaborn parameters.
  
  Parameters
  ----------
  subplot_spec : dict
      Keyword args for :meth:`matplotlib.figure.Figure.subplots`.
  facet_spec : dict
      Parameters that control subplot faceting.
  pair_spec : dict
      Parameters that control subplot pairing.
  data : PlotData
      Data used to define figure setup.
class_docstr_tok: ["Interface","for","creating","and","using","matplotlib","subplots","based","on","seaborn","parameters",".","Parameters","--","--","--","--","--","subplot_spec",":","dict","Keyword","args","for",":","meth",":","`","matplotlib.figure.Figure.subplots","`",".","facet_spec",":","dict","Parameters","that","control","subplot","faceting",".","pair_spec",":","dict","Parameters","that","control","subplot","pairing",".","data",":","PlotData","Data","used","to","define","figure","setup","."]
docstr: Update figure structure parameters based on facet/pair wrapping.
docstr_tok: ["Update","figure","structure","parameters","based","on","facet\/pair","wrapping","."]
code: def _handle_wrapping(
      self, facet_spec: FacetSpec, pair_spec: PairSpec
  ) -> None:
      """Update figure structure parameters based on facet/pair wrapping."""
      self.wrap = wrap = facet_spec.get("wrap") or pair_spec.get("wrap")
      if not wrap:
          return
  
      wrap_dim = "row" if self.subplot_spec["nrows"] > 1 else "col"
      flow_dim = {"row": "col", "col": "row"}[wrap_dim]
      n_subplots = self.subplot_spec[f"n{wrap_dim}s"]
      flow = int(np.ceil(n_subplots / wrap))
  
      if wrap < self.subplot_spec[f"n{wrap_dim}s"]:
          self.subplot_spec[f"n{wrap_dim}s"] = wrap
      self.subplot_spec[f"n{flow_dim}s"] = flow
      self.n_subplots = n_subplots
      self.wrap_dim = wrap_dim
  
file_path: seaborn/seaborn/_core/subplots.py
imports: from __future__ import annotations
  from collections.abc import Generator
  import numpy
  import matplotlib
  import matplotlib.pyplot
  from matplotlib.axes import Axes
  from matplotlib.figure import Figure
  from typing import TYPE_CHECKING
label_desc: Use image node_id 4 for calling the Subplots obj's underlying member method code with example usage: obj._handle_wrapping(facet_spec, pair_spec) without return types