allow to set levels

This commit is contained in:
2023-05-12 14:35:04 +02:00
parent 0742b9de0f
commit cf24d54b62

View File

@ -4,12 +4,13 @@ from .desc import Description
class ImageDescription(Description):
def __init__(self, name, title=None, xlabel=None, ylabel=None, image=None):
def __init__(self, name, title=None, xlabel=None, ylabel=None, image=None, levels=None):
self.name = name
self.title = title
self.xlabel = xlabel
self.ylabel = ylabel
self.image = image
self.levels = levels #TODO: might be better to use vmin and vmax
@property
def data(self):
@ -28,7 +29,7 @@ class ImageDescription(Description):
def make_plot(self, plotwidget, style):
res = plotwidget.setImage(self.data)
res = plotwidget.setImage(self.data, levels=self.levels)
if self.title:
plotwidget.setTitle(self.title)