From 2304c9f8497c1ab1492f3e6690bb79b0464c0df8 Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Tue, 5 Nov 2024 10:33:46 +0100 Subject: [PATCH] fix(plot_base): legend text color is changed when changing dark-light theme --- bec_widgets/widgets/figure/plots/plot_base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bec_widgets/widgets/figure/plots/plot_base.py b/bec_widgets/widgets/figure/plots/plot_base.py index 4a5dc3f5..1b61120e 100644 --- a/bec_widgets/widgets/figure/plots/plot_base.py +++ b/bec_widgets/widgets/figure/plots/plot_base.py @@ -147,6 +147,9 @@ class BECPlotBase(BECConnector, pg.GraphicsLayout): for axis in ["left", "bottom", "right", "top"]: self.plot_item.getAxis(axis).setPen(text_pen) self.plot_item.getAxis(axis).setTextPen(text_pen) + if self.plot_item.legend is not None: + for sample, label in self.plot_item.legend.items: + label.setText(label.text, color=palette.text().color()) def set(self, **kwargs) -> None: """