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

Method __init__

lib/matplotlib/lines.py:301–428  ·  view source on GitHub ↗

Create a `.Line2D` instance with *x* and *y* data in sequences of *xdata*, *ydata*. Additional keyword arguments are `.Line2D` properties: %(Line2D:kwdoc)s See :meth:`set_linestyle` for a description of the line styles, :meth:`set_marker` for a des

(self, xdata, ydata, *,
                 linewidth=None,  # all Nones default to rc
                 linestyle=None,
                 color=None,
                 gapcolor=None,
                 marker=None,
                 markersize=None,
                 markeredgewidth=None,
                 markeredgecolor=None,
                 markerfacecolor=None,
                 markerfacecoloralt='none',
                 fillstyle=None,
                 antialiased=None,
                 dash_capstyle=None,
                 solid_capstyle=None,
                 dash_joinstyle=None,
                 solid_joinstyle=None,
                 pickradius=5,
                 drawstyle=None,
                 markevery=None,
                 **kwargs
                 )

Source from the content-addressed store, hash-verified

299 map("({:g},{:g})".format, self._x, self._y))
300
301 def __init__(self, xdata, ydata, *,
302 linewidth=None, # all Nones default to rc
303 linestyle=None,
304 color=None,
305 gapcolor=None,
306 marker=None,
307 markersize=None,
308 markeredgewidth=None,
309 markeredgecolor=None,
310 markerfacecolor=None,
311 markerfacecoloralt='none',
312 fillstyle=None,
313 antialiased=None,
314 dash_capstyle=None,
315 solid_capstyle=None,
316 dash_joinstyle=None,
317 solid_joinstyle=None,
318 pickradius=5,
319 drawstyle=None,
320 markevery=None,
321 **kwargs
322 ):
323 """
324 Create a `.Line2D` instance with *x* and *y* data in sequences of
325 *xdata*, *ydata*.
326
327 Additional keyword arguments are `.Line2D` properties:
328
329 %(Line2D:kwdoc)s
330
331 See :meth:`set_linestyle` for a description of the line styles,
332 :meth:`set_marker` for a description of the markers, and
333 :meth:`set_drawstyle` for a description of the draw styles.
334
335 """
336 super().__init__()
337
338 # Convert sequences to NumPy arrays.
339 if not np.iterable(xdata):
340 raise RuntimeError('xdata must be a sequence')
341 if not np.iterable(ydata):
342 raise RuntimeError('ydata must be a sequence')
343
344 linewidth = mpl._val_or_rc(linewidth, 'lines.linewidth')
345 linestyle = mpl._val_or_rc(linestyle, 'lines.linestyle')
346 marker = mpl._val_or_rc(marker, 'lines.marker')
347 color = mpl._val_or_rc(color, 'lines.color')
348 markersize = mpl._val_or_rc(markersize, 'lines.markersize')
349 antialiased = mpl._val_or_rc(antialiased, 'lines.antialiased')
350 dash_capstyle = mpl._val_or_rc(dash_capstyle, 'lines.dash_capstyle')
351 dash_joinstyle = mpl._val_or_rc(dash_joinstyle, 'lines.dash_joinstyle')
352 solid_capstyle = mpl._val_or_rc(solid_capstyle, 'lines.solid_capstyle')
353 solid_joinstyle = mpl._val_or_rc(solid_joinstyle, 'lines.solid_joinstyle')
354
355 if drawstyle is None:
356 drawstyle = 'default'
357
358 self._dashcapstyle = None

Callers 1

__init__Method · 0.45

Calls 15

set_dash_capstyleMethod · 0.95
set_dash_joinstyleMethod · 0.95
set_solid_capstyleMethod · 0.95
set_solid_joinstyleMethod · 0.95
set_linewidthMethod · 0.95
set_linestyleMethod · 0.95
set_drawstyleMethod · 0.95
set_colorMethod · 0.95
set_gapcolorMethod · 0.95
set_markeveryMethod · 0.95
set_antialiasedMethod · 0.95
set_markersizeMethod · 0.95

Tested by

no test coverage detected