Set whether axis ticks and gridlines are above or below most artists. This controls the zorder of the ticks and gridlines. For more information on the zorder see :doc:`/gallery/misc/zorder_demo`. Parameters ---------- b : bool or 'line'
(self, b)
| 3402 | return self._axisbelow |
| 3403 | |
| 3404 | def set_axisbelow(self, b): |
| 3405 | """ |
| 3406 | Set whether axis ticks and gridlines are above or below most artists. |
| 3407 | |
| 3408 | This controls the zorder of the ticks and gridlines. For more |
| 3409 | information on the zorder see :doc:`/gallery/misc/zorder_demo`. |
| 3410 | |
| 3411 | Parameters |
| 3412 | ---------- |
| 3413 | b : bool or 'line' |
| 3414 | Possible values: |
| 3415 | |
| 3416 | - *True* (zorder = 0.5): Ticks and gridlines are below patches and |
| 3417 | lines, though still above images. |
| 3418 | - 'line' (zorder = 1.5): Ticks and gridlines are above patches |
| 3419 | (e.g. rectangles, with default zorder = 1) but still below lines |
| 3420 | and markers (with their default zorder = 2). |
| 3421 | - *False* (zorder = 2.5): Ticks and gridlines are above patches |
| 3422 | and lines / markers. |
| 3423 | |
| 3424 | Notes |
| 3425 | ----- |
| 3426 | For more control, call the `~.Artist.set_zorder` method of each axis. |
| 3427 | |
| 3428 | See Also |
| 3429 | -------- |
| 3430 | get_axisbelow |
| 3431 | """ |
| 3432 | # Check that b is True, False or 'line' |
| 3433 | self._axisbelow = axisbelow = validate_axisbelow(b) |
| 3434 | zorder = { |
| 3435 | True: 0.5, |
| 3436 | 'line': 1.5, |
| 3437 | False: 2.5, |
| 3438 | }[axisbelow] |
| 3439 | for axis in self._axis_map.values(): |
| 3440 | axis.set_zorder(zorder) |
| 3441 | self.stale = True |
| 3442 | |
| 3443 | @_docstring.interpd |
| 3444 | def grid(self, visible=None, which='major', axis='both', **kwargs): |