Skip to content

Commit 306bed3

Browse files
committed
Fix dot array example
(keep separate display params and object params)
1 parent 1816b6a commit 306bed3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

plotpy/tests/widgets/test_dotarraydemo.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from plotpy.items import RawImageItem
3535
from plotpy.items.curve.errorbar import vmap
3636
from plotpy.plot import PlotDialog, PlotOptions
37+
from plotpy.styles import RawImageParam
3738
from plotpy.tools import CopyToClipboardTool, HelpTool, PrintTool, SaveAsTool
3839

3940
if TYPE_CHECKING:
@@ -68,6 +69,10 @@ def update_param(self, obj):
6869
pass
6970

7071

72+
class DotArrayRawImageParam(RawImageParam, DotArrayParam):
73+
pass
74+
75+
7176
class DotArrayItem(RawImageItem):
7277
"""Dot array item"""
7378

@@ -180,10 +185,13 @@ def show_data(self, param):
180185
"""Show data"""
181186
plot = self.plot_widget.plot
182187
if self.item is None:
188+
itemparam = DotArrayRawImageParam()
189+
gds.update_dataset(itemparam, param)
183190
param._update_cb = lambda: self.stamp_gbox.get()
184-
self.item = DotArrayItem(param)
191+
self.item = DotArrayItem(itemparam)
185192
plot.add_item(self.item)
186193
else:
194+
gds.update_dataset(self.item.param, param)
187195
self.item.update_border()
188196
plot.do_autoscale()
189197

0 commit comments

Comments
 (0)