renamed "title" -> "name" for consistency; added addLegend
This commit is contained in:
@ -5,8 +5,8 @@ from ..theme import pg_plot_style, pg_plot_style_cycler
|
||||
|
||||
class MDISubPlot(MDISubWindow):
|
||||
|
||||
def __init__(self, title, desc, *args, **kwargs):
|
||||
super().__init__(title, *args, **kwargs)
|
||||
def __init__(self, name, desc, *args, **kwargs):
|
||||
super().__init__(name, *args, **kwargs)
|
||||
|
||||
style = pg_plot_style()
|
||||
|
||||
@ -18,13 +18,14 @@ class MDISubPlot(MDISubWindow):
|
||||
|
||||
class MDISubMultiPlot(MDISubWindow):
|
||||
|
||||
def __init__(self, titles, descs, *args, **kwargs):
|
||||
title = " | ".join(titles)
|
||||
super().__init__(title, *args, **kwargs)
|
||||
def __init__(self, names, descs, *args, **kwargs):
|
||||
name = " | ".join(names)
|
||||
super().__init__(name, *args, **kwargs)
|
||||
|
||||
psc = pg_plot_style_cycler()
|
||||
|
||||
plt = pg.PlotWidget()
|
||||
plt.addLegend()
|
||||
self.plots = [d.make_plot(plt, s) for d, s in zip(descs, psc)]
|
||||
self.setWidget(plt)
|
||||
|
||||
|
Reference in New Issue
Block a user