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

Method new_locator

lib/mpl_toolkits/axes_grid1/axes_divider.py:170–200  ·  view source on GitHub ↗

Return an axes locator callable for the specified cell. Parameters ---------- nx, nx1 : int Integers specifying the column-position of the cell. When *nx1* is None, a single *nx*-th column is specified. Otherwise, location of colu

(self, nx, ny, nx1=None, ny1=None)

Source from the content-addressed store, hash-verified

168 return np.cumsum([0, *(sizes @ [k, 1])])
169
170 def new_locator(self, nx, ny, nx1=None, ny1=None):
171 """
172 Return an axes locator callable for the specified cell.
173
174 Parameters
175 ----------
176 nx, nx1 : int
177 Integers specifying the column-position of the
178 cell. When *nx1* is None, a single *nx*-th column is
179 specified. Otherwise, location of columns spanning between *nx*
180 to *nx1* (but excluding *nx1*-th column) is specified.
181 ny, ny1 : int
182 Same as *nx* and *nx1*, but for row positions.
183 """
184 if nx1 is None:
185 nx1 = nx + 1
186 if ny1 is None:
187 ny1 = ny + 1
188 # append_size("left") adds a new size at the beginning of the
189 # horizontal size lists; this shift transforms e.g.
190 # new_locator(nx=2, ...) into effectively new_locator(nx=3, ...). To
191 # take that into account, instead of recording nx, we record
192 # nx-self._xrefindex, where _xrefindex is shifted by 1 by each
193 # append_size("left"), and re-add self._xrefindex back to nx in
194 # _locate, when the actual axes position is computed. Ditto for y.
195 xref = self._xrefindex
196 yref = self._yrefindex
197 locator = functools.partial(
198 self._locate, nx - xref, ny - yref, nx1 - xref, ny1 - yref)
199 locator.get_subplotspec = self.get_subplotspec
200 return locator
201
202 def _locate(self, nx, ny, nx1, ny1, axes, renderer):
203 """

Callers 14

make_rgb_axesFunction · 0.45
_init_locatorsMethod · 0.45
_init_locatorsMethod · 0.45
new_horizontalMethod · 0.45
new_verticalMethod · 0.45
new_locatorMethod · 0.45
new_locatorMethod · 0.45
make_axes_locatableFunction · 0.45

Calls

no outgoing calls

Tested by 1