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

Method clear

lib/mpl_toolkits/axisartist/axislines.py:392–418  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

390 return self._axislines
391
392 def clear(self):
393 # docstring inherited
394
395 # Init gridlines before clear() as clear() calls grid().
396 self.gridlines = gridlines = GridlinesCollection(
397 [],
398 colors=mpl.rcParams['grid.color'],
399 linestyles=mpl.rcParams['grid.linestyle'],
400 linewidths=mpl.rcParams['grid.linewidth'])
401 self._set_artist_props(gridlines)
402 gridlines.set_grid_helper(self.get_grid_helper())
403
404 super().clear()
405
406 # clip_path is set after Axes.clear(): that's when a patch is created.
407 gridlines.set_clip_path(self.axes.patch)
408
409 # Init axis artists.
410 self._axislines = mpl_axes.Axes.AxisDict(self)
411 new_fixed_axis = self.get_grid_helper().new_fixed_axis
412 self._axislines.update({
413 loc: new_fixed_axis(loc=loc, axes=self, axis_direction=loc)
414 for loc in ["bottom", "top", "left", "right"]})
415 for axisline in [self._axislines["top"], self._axislines["right"]]:
416 axisline.label.set_visible(False)
417 axisline.major_ticklabels.set_visible(False)
418 axisline.minor_ticklabels.set_visible(False)
419
420 def get_grid_helper(self):
421 return self._grid_helper

Callers 2

clearMethod · 0.45
test_curvelinear4Function · 0.45

Calls 7

set_grid_helperMethod · 0.95
get_grid_helperMethod · 0.95
GridlinesCollectionClass · 0.85
_set_artist_propsMethod · 0.45
set_clip_pathMethod · 0.45
updateMethod · 0.45
set_visibleMethod · 0.45

Tested by 1

test_curvelinear4Function · 0.36