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

Function ohlc

bqplot/pyplot.py:741–772  ·  view source on GitHub ↗

Draw OHLC bars or candle bars in the current context figure. Signature: `ohlc(x, y, **kwargs)` or `ohlc(y, **kwargs)`, depending of the length of the list of positional arguments. In the case where the `x` array is not provided Parameters ---------- x: numpy.ndarray or list

(*args, **kwargs)

Source from the content-addressed store, hash-verified

739
740
741def ohlc(*args, **kwargs):
742 """Draw OHLC bars or candle bars in the current context figure.
743
744 Signature: `ohlc(x, y, **kwargs)` or `ohlc(y, **kwargs)`, depending of the
745 length of the list of positional arguments. In the case where the `x` array
746 is not provided
747
748 Parameters
749 ----------
750 x: numpy.ndarray or list, 1d (optional)
751 The x-coordinates of the plotted line. When not provided, the function
752 defaults to `numpy.arange(len(y))`.
753 y: numpy.ndarray or list, 2d
754 The ohlc (open/high/low/close) information. A two dimensional array. y
755 must have the shape (n, 4).
756 options: dict (default: {})
757 Options for the scales to be created. If a scale labeled 'x' is
758 required for that mark, options['x'] contains optional keyword
759 arguments for the constructor of the corresponding scale type.
760 axes_options: dict (default: {})
761 Options for the axes to be created. If an axis labeled 'x' is required
762 for that mark, axes_options['x'] contains optional keyword arguments
763 for the constructor of the corresponding axis type.
764 """
765 if len(args) == 2:
766 kwargs['x'] = args[0]
767 kwargs['y'] = args[1]
768 elif len(args) == 1:
769 kwargs['y'] = args[0]
770 length = len(args[0])
771 kwargs['x'] = arange(length)
772 return _draw_mark(OHLC, **kwargs)
773
774
775@_process_data('color', 'opacity', 'size', 'skew', 'rotation')

Callers

nothing calls this directly

Calls 1

_draw_markFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…