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

Class Line2D

lib/matplotlib/lines.py:243–1490  ·  view source on GitHub ↗

A line - the line can have both a solid linestyle connecting all the vertices, and a marker at each vertex. Additionally, the drawing of the solid line is influenced by the drawstyle, e.g., one can create "stepped" lines in various styles.

Source from the content-addressed store, hash-verified

241 "markersize": ["ms"],
242})
243class Line2D(Artist):
244 """
245 A line - the line can have both a solid linestyle connecting all
246 the vertices, and a marker at each vertex. Additionally, the
247 drawing of the solid line is influenced by the drawstyle, e.g., one
248 can create "stepped" lines in various styles.
249 """
250
251 lineStyles = _lineStyles = { # hidden names deprecated
252 '-': '_draw_solid',
253 '--': '_draw_dashed',
254 '-.': '_draw_dash_dot',
255 ':': '_draw_dotted',
256 'None': '_draw_nothing',
257 ' ': '_draw_nothing',
258 '': '_draw_nothing',
259 }
260
261 _drawStyles_l = {
262 'default': '_draw_lines',
263 'steps-mid': '_draw_steps_mid',
264 'steps-pre': '_draw_steps_pre',
265 'steps-post': '_draw_steps_post',
266 }
267
268 _drawStyles_s = {
269 'steps': '_draw_steps_pre',
270 }
271
272 # drawStyles should now be deprecated.
273 drawStyles = {**_drawStyles_l, **_drawStyles_s}
274 # Need a list ordered with long names first:
275 drawStyleKeys = [*_drawStyles_l, *_drawStyles_s]
276
277 # Referenced here to maintain API. These are defined in
278 # MarkerStyle
279 markers = MarkerStyle.markers
280 filled_markers = MarkerStyle.filled_markers
281 fillStyles = MarkerStyle.fillstyles
282
283 zorder = 2
284
285 _subslice_optim_min_size = 1000
286
287 def __str__(self):
288 if self._label != "":
289 return f"Line2D({self._label})"
290 elif self._x is None:
291 return "Line2D()"
292 elif len(self._x) > 3:
293 return "Line2D(({:g},{:g}),({:g},{:g}),...,({:g},{:g}))".format(
294 self._x[0], self._y[0],
295 self._x[1], self._y[1],
296 self._x[-1], self._y[-1])
297 else:
298 return "Line2D(%s)" % ",".join(
299 map("({:g},{:g})".format, self._x, self._y))
300

Callers 15

create_artistsMethod · 0.90
create_artistsMethod · 0.90
_create_lineMethod · 0.90
create_artistsMethod · 0.90
create_artistsMethod · 0.90
create_artistsMethod · 0.90
legend_elementsMethod · 0.90
create_artistsMethod · 0.90
custom_legends.pyFile · 0.90
__init__Method · 0.90
draw_sizebarFunction · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…