From f7f372ed7f8d45388944896c98200628081adefb Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Wed, 25 Jan 2023 11:22:31 +0100 Subject: [PATCH] a bit more expressiveness --- grum/mdi/mdisubplot.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/grum/mdi/mdisubplot.py b/grum/mdi/mdisubplot.py index b006315..1c77d0f 100644 --- a/grum/mdi/mdisubplot.py +++ b/grum/mdi/mdisubplot.py @@ -7,13 +7,13 @@ class MDISubPlot(MDISubWindow): def __init__(self, name, desc, *args, **kwargs): super().__init__(name, *args, **kwargs) + pw = pg.PlotWidget() + self.setWidget(pw) style = pg_plot_style() - plt = pg.PlotWidget() - plot = desc.make_plot(plt, style) + plot = desc.make_plot(pw, style) self.plots = {name: plot} - self.setWidget(plt) @@ -21,14 +21,14 @@ class MDISubMultiPlot(MDISubWindow): def __init__(self, name, descs, *args, **kwargs): super().__init__(name, *args, **kwargs) + pw = pg.PlotWidget() + self.setWidget(pw) ls = pg_legend_style() psc = pg_plot_style_cycler() - plt = pg.PlotWidget() - plt.addLegend(**ls) - self.plots = {n: d.make_plot(plt, s) for (n, d), s in zip(descs.items(), psc)} - self.setWidget(plt) + pw.addLegend(**ls) + self.plots = {name: desc.make_plot(pw, style) for (name, desc), style in zip(descs.items(), psc)}