Configure the grid lines. Parameters ---------- b : bool or None Whether to show the grid lines. If any *kwargs* are supplied, it is assumed you want the grid on and *b* will be set to True. If *b* is *None* and there are no *kwa
(self, b=None, which='major', **kwargs)
| 1416 | return self.minorTicks[:numticks] |
| 1417 | |
| 1418 | def grid(self, b=None, which='major', **kwargs): |
| 1419 | """ |
| 1420 | Configure the grid lines. |
| 1421 | |
| 1422 | Parameters |
| 1423 | ---------- |
| 1424 | b : bool or None |
| 1425 | Whether to show the grid lines. If any *kwargs* are supplied, |
| 1426 | it is assumed you want the grid on and *b* will be set to True. |
| 1427 | |
| 1428 | If *b* is *None* and there are no *kwargs*, this toggles the |
| 1429 | visibility of the lines. |
| 1430 | |
| 1431 | which : {'major', 'minor', 'both'} |
| 1432 | The grid lines to apply the changes on. |
| 1433 | |
| 1434 | **kwargs : `.Line2D` properties |
| 1435 | Define the line properties of the grid, e.g.:: |
| 1436 | |
| 1437 | grid(color='r', linestyle='-', linewidth=2) |
| 1438 | |
| 1439 | """ |
| 1440 | if len(kwargs): |
| 1441 | b = True |
| 1442 | which = which.lower() |
| 1443 | gridkw = {'grid_' + item[0]: item[1] for item in kwargs.items()} |
| 1444 | if which in ['minor', 'both']: |
| 1445 | if b is None: |
| 1446 | self._gridOnMinor = not self._gridOnMinor |
| 1447 | else: |
| 1448 | self._gridOnMinor = b |
| 1449 | self.set_tick_params(which='minor', gridOn=self._gridOnMinor, |
| 1450 | **gridkw) |
| 1451 | if which in ['major', 'both']: |
| 1452 | if b is None: |
| 1453 | self._gridOnMajor = not self._gridOnMajor |
| 1454 | else: |
| 1455 | self._gridOnMajor = b |
| 1456 | self.set_tick_params(which='major', gridOn=self._gridOnMajor, |
| 1457 | **gridkw) |
| 1458 | self.stale = True |
| 1459 | |
| 1460 | def update_units(self, data): |
| 1461 | """ |
no test coverage detected