MCPcopy
hub / github.com/matplotlib/matplotlib / add_line

Method add_line

lib/matplotlib/axes/_base.py:2451–2467  ·  view source on GitHub ↗

Add a `.Line2D` to the Axes; return the line.

(self, line)

Source from the content-addressed store, hash-verified

2449 self.axes.update_datalim(((xmin, ymin), (xmax, ymax)))
2450
2451 def add_line(self, line):
2452 """
2453 Add a `.Line2D` to the Axes; return the line.
2454 """
2455 _api.check_isinstance(mlines.Line2D, line=line)
2456 self._set_artist_props(line)
2457 if line.get_clip_path() is None:
2458 line.set_clip_path(self.patch)
2459
2460 self._update_line_limits(line)
2461 if not line.get_label():
2462 line.set_label(f'_child{len(self._children)}')
2463 self._children.append(line)
2464 line._remove_method = self._children.remove
2465 self.stale = True
2466 line._set_in_autoscale(True)
2467 return line
2468
2469 def _add_text(self, txt):
2470 """

Callers 15

errorbarMethod · 0.80
handlerMethod · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
axhlineMethod · 0.80
axvlineMethod · 0.80
plotMethod · 0.80
errorbarMethod · 0.80
spyMethod · 0.80
test_stairsFunction · 0.80

Calls 7

_set_artist_propsMethod · 0.95
_update_line_limitsMethod · 0.95
_set_in_autoscaleMethod · 0.80
get_clip_pathMethod · 0.45
set_clip_pathMethod · 0.45
get_labelMethod · 0.45
set_labelMethod · 0.45

Tested by 1

test_stairsFunction · 0.64