added name as mandatory argument of PlotDescription
This commit is contained in:
@ -22,6 +22,7 @@ for i in range(20):
|
||||
exampledata = {}
|
||||
for k, v in exampledata_raw.items():
|
||||
pd = PlotDescription(
|
||||
k,
|
||||
# title=k,
|
||||
xlabel="x",
|
||||
ylabel="y"
|
||||
|
@ -51,7 +51,7 @@ class MainWindow(QMainWindow):
|
||||
|
||||
|
||||
def new_plot(self, name, cfg):
|
||||
desc = PlotDescription(**cfg)
|
||||
desc = PlotDescription(name, **cfg)
|
||||
self.lst.set(name, desc)
|
||||
if self.menu_settings.checkboxes["Open new plots"].isChecked():
|
||||
if not self.mdi.findSubWindow(name):
|
||||
|
@ -1,7 +1,8 @@
|
||||
|
||||
class PlotDescription:
|
||||
|
||||
def __init__(self, title=None, xlabel=None, ylabel=None):
|
||||
def __init__(self, name, title=None, xlabel=None, ylabel=None):
|
||||
self.name = name
|
||||
self.title = title
|
||||
self.xlabel = xlabel
|
||||
self.ylabel = ylabel
|
||||
@ -21,7 +22,7 @@ class PlotDescription:
|
||||
|
||||
|
||||
def make_plot(self, plotwidget, style):
|
||||
res = plotwidget.plot(self.xs, self.ys, **style)
|
||||
res = plotwidget.plot(self.xs, self.ys, name=self.name, **style)
|
||||
|
||||
if self.title:
|
||||
plotwidget.setTitle(self.title)
|
||||
|
Reference in New Issue
Block a user