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

Function hline

bqplot/pyplot.py:453–479  ·  view source on GitHub ↗

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

(level, **kwargs)

Source from the content-addressed store, hash-verified

451
452
453def hline(level, **kwargs):
454 """Draws a horizontal line at the given level.
455
456 Parameters
457 ----------
458 level: float
459 The level at which to draw the horizontal line.
460 preserve_domain: boolean (default: False)
461 If true, the line does not affect the domain of the 'y' scale.
462 """
463 kwargs.setdefault('colors', ['dodgerblue'])
464 kwargs.setdefault('stroke_width', 1)
465 scales = kwargs.pop('scales', {})
466 fig = kwargs.get('figure', current_figure())
467 scales['x'] = fig.scale_x
468
469 level = array(level)
470 if len(level.shape) == 0:
471 x = [0, 1]
472 y = [level, level]
473 else:
474 x = [0, 1]
475 y = column_stack([level, level])
476 return plot(x, y, scales=scales, preserve_domain={
477 'x': True,
478 'y': kwargs.get('preserve_domain', False)
479 }, axes=False, update_context=False, **kwargs)
480
481
482def vline(level, **kwargs):

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…