class_docstr: A base class of GridSpec that specifies the geometry of the grid
  that a subplot will be placed.
class_docstr_tok: ["A","base","class","of","GridSpec","that","specifies","the","geometry","of","the","grid","that","a","subplot","will","be","placed","."]
docstr: Set the relative widths of the columns.
  
  *width_ratios* must be of length *ncols*. Each column gets a relative
  width of ``width_ratios[i] / sum(width_ratios)``.
code: def set_width_ratios(self, width_ratios):
      """
      Set the relative widths of the columns.
  
      *width_ratios* must be of length *ncols*. Each column gets a relative
      width of ``width_ratios[i] / sum(width_ratios)``.
      """
      if width_ratios is None:
          width_ratios = [1] * self._ncols
      elif len(width_ratios) != self._ncols:
          raise ValueError(
              "Expected the given number of width ratios to "
              "match the number of columns of the grid"
          )
      self._col_width_ratios = width_ratios
  
imports: import copy
  import logging
  from numbers import Integral
  import numpy
  import matplotlib
  from matplotlib import _api, _pylab_helpers, _tight_layout
  from matplotlib.transforms import Bbox
label_desc: Use image node_id 6 for calling the GridSpecBase obj's underlying member method code with example usage: obj.set_width_ratios(width_ratios) without return types