diff --git a/pyqtgraph/graphicsItems/GradientEditorItem.py b/pyqtgraph/graphicsItems/GradientEditorItem.py index 5a7ca211..d57576c8 100644 --- a/pyqtgraph/graphicsItems/GradientEditorItem.py +++ b/pyqtgraph/graphicsItems/GradientEditorItem.py @@ -473,7 +473,8 @@ class GradientEditorItem(TickSliderItem): def loadPreset(self, name): """ - Load a predefined gradient. + Load a predefined gradient. Currently defined gradients are: 'thermal', + 'flame', 'yellowy', 'bipolar', 'spectrum', 'cyclic', 'greyclip', and 'grey'. """ ## TODO: provide image with names of defined gradients #global Gradients diff --git a/pyqtgraph/imageview/ImageView.py b/pyqtgraph/imageview/ImageView.py index 466b4bcf..6832f316 100644 --- a/pyqtgraph/imageview/ImageView.py +++ b/pyqtgraph/imageview/ImageView.py @@ -721,4 +721,10 @@ class ImageView(QtGui.QWidget): def setColorMap(self, colormap): """Set the color map. *colormap* is an instance of ColorMap()""" self.ui.histogram.gradient.setColorMap(colormap) - + + def setPredefinedGradient(self, name): + """Set one of the gradients defined in :class:`GradientEditorItem ` + Currently defined gradients are: 'thermal', 'flame', 'yellowy', 'bipolar', + 'spectrum', 'cyclic', 'greyclip', and 'grey'. + """ + self.ui.histogram.gradient.loadPreset(name)