Toggle the gridlines, and optionally set the properties of the lines.
(self, visible=None, which='major', axis="both", **kwargs)
| 421 | return self._grid_helper |
| 422 | |
| 423 | def grid(self, visible=None, which='major', axis="both", **kwargs): |
| 424 | """ |
| 425 | Toggle the gridlines, and optionally set the properties of the lines. |
| 426 | """ |
| 427 | # There are some discrepancies in the behavior of grid() between |
| 428 | # axes_grid and Matplotlib, because axes_grid explicitly sets the |
| 429 | # visibility of the gridlines. |
| 430 | super().grid(visible, which=which, axis=axis, **kwargs) |
| 431 | if not self._axisline_on: |
| 432 | return |
| 433 | if visible is None: |
| 434 | visible = (self.axes.xaxis._minor_tick_kw["gridOn"] |
| 435 | or self.axes.xaxis._major_tick_kw["gridOn"] |
| 436 | or self.axes.yaxis._minor_tick_kw["gridOn"] |
| 437 | or self.axes.yaxis._major_tick_kw["gridOn"]) |
| 438 | self.gridlines.set(which=which, axis=axis, visible=visible) |
| 439 | self.gridlines.set(**kwargs) |
| 440 | |
| 441 | def get_children(self): |
| 442 | if self._axisline_on: |