From 48720950d158104e03002ecf19ca66926c3682dd Mon Sep 17 00:00:00 2001 From: kushalkolar Date: Sun, 1 Jun 2025 23:52:45 -0400 Subject: [PATCH] fix --- fastplotlib/widgets/image_widget/_widget.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fastplotlib/widgets/image_widget/_widget.py b/fastplotlib/widgets/image_widget/_widget.py index b3fe1d05d..650097951 100644 --- a/fastplotlib/widgets/image_widget/_widget.py +++ b/fastplotlib/widgets/image_widget/_widget.py @@ -942,8 +942,10 @@ def set_data( # make new graphic first new_graphic = ImageGraphic(data=frame, name="image_widget_managed") - # set hlut tool to use new graphic - subplot.docks["right"]["histogram_lut"].image_graphic = new_graphic + if self._histogram_widget: + # set hlut tool to use new graphic + subplot.docks["right"]["histogram_lut"].image_graphic = new_graphic + # delete old graphic after setting hlut tool to new graphic # this ensures gc subplot.delete_graphic(graphic=subplot["image_widget_managed"])