class pyqtgraph.GradientWidget(parent=None, orientation='bottom', *args, **kargs)[source]#

Widget displaying an editable color gradient. The user may add, move, recolor, or remove colors from the gradient. Additionally, a context menu allows the user to select from pre-defined gradients.

__init__(parent=None, orientation='bottom', *args, **kargs)[source]#

The orientation argument may be ‘bottom’, ‘top’, ‘left’, or ‘right’ indicating whether the gradient is displayed horizontally (top, bottom) or vertically (left, right) and on what side of the gradient the editable ticks will appear.

All other arguments are passed to GradientEditorItem.__init__.

Note: For convenience, this class wraps methods from GradientEditorItem.


Set the orientation of the widget. May be one of ‘bottom’, ‘top’, ‘left’, or ‘right’.