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

Method set_params

lib/matplotlib/ticker.py:2185–2226  ·  view source on GitHub ↗

Set parameters for this locator. Parameters ---------- nbins : int or 'auto', optional see `.MaxNLocator` steps : array-like, optional see `.MaxNLocator` integer : bool, optional see `.MaxNLocator` symmetri

(self, **kwargs)

Source from the content-addressed store, hash-verified

2183 return np.concatenate([0.1 * steps[:-1], steps, [10 * steps[1]]])
2184
2185 def set_params(self, **kwargs):
2186 """
2187 Set parameters for this locator.
2188
2189 Parameters
2190 ----------
2191 nbins : int or 'auto', optional
2192 see `.MaxNLocator`
2193 steps : array-like, optional
2194 see `.MaxNLocator`
2195 integer : bool, optional
2196 see `.MaxNLocator`
2197 symmetric : bool, optional
2198 see `.MaxNLocator`
2199 prune : {'lower', 'upper', 'both', None}, optional
2200 see `.MaxNLocator`
2201 min_n_ticks : int, optional
2202 see `.MaxNLocator`
2203 """
2204 if 'nbins' in kwargs:
2205 self._nbins = kwargs.pop('nbins')
2206 if self._nbins != 'auto':
2207 self._nbins = int(self._nbins)
2208 if 'symmetric' in kwargs:
2209 self._symmetric = kwargs.pop('symmetric')
2210 if 'prune' in kwargs:
2211 prune = kwargs.pop('prune')
2212 _api.check_in_list(['upper', 'lower', 'both', None], prune=prune)
2213 self._prune = prune
2214 if 'min_n_ticks' in kwargs:
2215 self._min_n_ticks = max(1, kwargs.pop('min_n_ticks'))
2216 if 'steps' in kwargs:
2217 steps = kwargs.pop('steps')
2218 if steps is None:
2219 self._steps = np.array([1, 1.5, 2, 2.5, 3, 4, 5, 6, 8, 10])
2220 else:
2221 self._steps = self._validate_steps(steps)
2222 self._extended_steps = self._staircase(self._steps)
2223 if 'integer' in kwargs:
2224 self._integer = kwargs.pop('integer')
2225 if kwargs:
2226 raise _api.kwarg_error("set_params", kwargs)
2227
2228 def _raw_ticks(self, vmin, vmax):
2229 """

Callers 2

__init__Method · 0.95
test_maxn_majorMethod · 0.95

Calls 3

_validate_stepsMethod · 0.95
_staircaseMethod · 0.95
popMethod · 0.45

Tested by 1

test_maxn_majorMethod · 0.76