MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_width_ratios

Method set_width_ratios

lib/matplotlib/gridspec.py:101–113  ·  view source on GitHub ↗

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)``.

(self, width_ratios)

Source from the content-addressed store, hash-verified

99 return subplotspec
100
101 def set_width_ratios(self, width_ratios):
102 """
103 Set the relative widths of the columns.
104
105 *width_ratios* must be of length *ncols*. Each column gets a relative
106 width of ``width_ratios[i] / sum(width_ratios)``.
107 """
108 if width_ratios is None:
109 width_ratios = [1] * self._ncols
110 elif len(width_ratios) != self._ncols:
111 raise ValueError('Expected the given number of width ratios to '
112 'match the number of columns of the grid')
113 self._col_width_ratios = width_ratios
114
115 def get_width_ratios(self):
116 """

Callers 2

__init__Method · 0.95
make_axes_gridspecFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected