MCPcopy Index your code
hub / github.com/bqplot/bqplot / vline

Function vline

bqplot/pyplot.py:482–510  ·  view source on GitHub ↗

Draws a vertical line at the given level. Parameters ---------- level: float The level at which to draw the vertical line. preserve_domain: boolean (default: False) If true, the line does not affect the domain of the 'x' scale.

(level, **kwargs)

Source from the content-addressed store, hash-verified

480
481
482def vline(level, **kwargs):
483 """Draws a vertical line at the given level.
484
485 Parameters
486 ----------
487 level: float
488 The level at which to draw the vertical line.
489 preserve_domain: boolean (default: False)
490 If true, the line does not affect the domain of the 'x' scale.
491 """
492 kwargs.setdefault('colors', ['dodgerblue'])
493 kwargs.setdefault('stroke_width', 1)
494 scales = kwargs.pop('scales', {})
495 fig = kwargs.get('figure', current_figure())
496 scales['y'] = fig.scale_y
497
498 level = array(level)
499 if len(level.shape) == 0:
500 x = [level, level]
501 y = [0, 1]
502 else:
503 x = column_stack([level, level])
504 # TODO: repeating [0, 1] should not be required once we allow for
505 # 2-D x and 1-D y
506 y = [[0, 1]] * len(level)
507 return plot(x, y, scales=scales, preserve_domain={
508 'x': kwargs.get('preserve_domain', False),
509 'y': True
510 }, axes=False, update_context=False, **kwargs)
511
512
513def _process_cmap(cmap):

Callers

nothing calls this directly

Calls 2

current_figureFunction · 0.85
plotFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…