Commit ad40b1ee authored by Yan's avatar Yan
Browse files

Added legend, set coloring for daughter table

parent b0964eba
......@@ -77,17 +77,31 @@ def update_drlspectrum(ptable, dtable, ds, drlspectrum):
#Dont do when the dataset is not populated
if (type(ds['masses'])) == type(None):
return
colors = np.array([[255,0,0],[0,255,0],[0,0,255],[0,200,255],[255,0,255],[255,200,0]])
names, times, intensities = get_daughterset(ptable, dtable, ds)
for i in range(len(drlspectrum.lines)):
drlspectrum.lines[0].remove()
for i in intensities:
drlspectrum.plot(times, i)
for i,j in enumerate(intensities):
drlspectrum.plot(times, j, label=names[i],
color=(colors[i%len(colors)] / 255))
if len(names) != 0:
drlspectrum.set_ylim(top=np.amax(intensities)*1.1,
bottom=np.amax(intensities)*-0.01)
drlspectrum.legend()
drlspectrum.figure.canvas.draw()
count = 0
for row in range(dtable.rowCount()):
#print(row)
print(count)
if dtable.cellWidget(row, 1).checkState() ==2:
dtable.item(row,0).setBackground(QtGui.QBrush(
QtGui.QColor(*colors[count%len(colors)], alpha=50)))
count += 1
else:
dtable.item(row,0).setBackground(QtGui.QBrush())
def getTableItemList(ptable):
ion_list = []
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment