allow to set levels
This commit is contained in:
@ -4,12 +4,13 @@ from .desc import Description
|
|||||||
|
|
||||||
class ImageDescription(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.name = name
|
||||||
self.title = title
|
self.title = title
|
||||||
self.xlabel = xlabel
|
self.xlabel = xlabel
|
||||||
self.ylabel = ylabel
|
self.ylabel = ylabel
|
||||||
self.image = image
|
self.image = image
|
||||||
|
self.levels = levels #TODO: might be better to use vmin and vmax
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def data(self):
|
def data(self):
|
||||||
@ -28,7 +29,7 @@ class ImageDescription(Description):
|
|||||||
|
|
||||||
|
|
||||||
def make_plot(self, plotwidget, style):
|
def make_plot(self, plotwidget, style):
|
||||||
res = plotwidget.setImage(self.data)
|
res = plotwidget.setImage(self.data, levels=self.levels)
|
||||||
|
|
||||||
if self.title:
|
if self.title:
|
||||||
plotwidget.setTitle(self.title)
|
plotwidget.setTitle(self.title)
|
||||||
|
Reference in New Issue
Block a user