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

Method _contour_args

lib/matplotlib/contour.py:1375–1400  ·  view source on GitHub ↗
(self, args, kwargs)

Source from the content-addressed store, hash-verified

1373 return kwargs
1374
1375 def _contour_args(self, args, kwargs):
1376 if self.filled:
1377 fn = 'contourf'
1378 else:
1379 fn = 'contour'
1380 nargs = len(args)
1381
1382 if 0 < nargs <= 2:
1383 z, *args = args
1384 z = ma.asarray(z)
1385 x, y = self._initialize_x_y(z)
1386 elif 2 < nargs <= 4:
1387 x, y, z_orig, *args = args
1388 x, y, z = self._check_xyz(x, y, z_orig, kwargs)
1389
1390 else:
1391 raise _api.nargs_error(fn, takes="from 1 to 4", given=nargs)
1392 z = ma.masked_invalid(z, copy=False)
1393 self.zmax = z.max().astype(float)
1394 self.zmin = z.min().astype(float)
1395 if self.logscale and self.zmin <= 0:
1396 z = ma.masked_where(z <= 0, z)
1397 _api.warn_external('Log scale: values of z <= 0 have been masked')
1398 self.zmin = z.min().astype(float)
1399 self._process_contour_level_args(args, z.dtype)
1400 return (x, y, z)
1401
1402 def _check_xyz(self, x, y, z, kwargs):
1403 """

Callers 1

_process_argsMethod · 0.95

Calls 5

_initialize_x_yMethod · 0.95
_check_xyzMethod · 0.95
maxMethod · 0.80
minMethod · 0.80

Tested by

no test coverage detected