Skip to content

Commit 99d5f6c

Browse files
committed
Fixed live display issus during experimentation
1 parent a772e67 commit 99d5f6c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

application.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def reactUpdate(self, event):
123123
if plot_type == "2D":
124124
# In this case we should have a list of spectrum as given by
125125
# Spectrum_Storage[folder_id, subfolder_id, :]:
126-
# [(channel_id, spectrum), ...]
126+
# {channel_id: spectrum, ...}
127127

128128
for channel_name, spectrum in tp_instruction[1].items():
129129
plotting_area.plot(
@@ -147,19 +147,19 @@ def reactUpdate(self, event):
147147

148148
colormap = plt.get_cmap("plasma")
149149

150-
cNorm = colors.Normalize(vmin=0, vmax=values[-1])
150+
cNorm = colors.Normalize(vmin=values[0], vmax=values[-1])
151151

152152
scalarMap = cmx.ScalarMappable(norm=cNorm, cmap=colormap)
153153

154154
for idx in range(len(values)):
155-
spectrum = tp_instruction[idx]
155+
spectrum = tp_instruction[1][idx]
156156
colorVal = scalarMap.to_rgba(values[idx])
157157
plotting_area.plot(
158158
spectrum.lambdas, spectrum.values,
159159
color=colorVal
160160
)
161-
plotting_area.xlabel("Wavelength (nm)")
162-
plotting_area.ylabel("Counts")
161+
plotting_area.xlabel("Wavelength (nm)")
162+
plotting_area.ylabel("Counts")
163163
canvas.draw()
164164

165165
# %% Application Object, true application is happening here

0 commit comments

Comments
 (0)