Skip to content

Commit 9626844

Browse files
authored
Merge pull request #7299 from eendebakpt/plot_dataset_fix
Fix bug in plot_data when a single parameter is selected
2 parents 7396b50 + 15c2cc0 commit 9626844

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/qcodes/dataset/plotting.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,15 @@ def plot_dataset(
268268

269269
log.debug(f"Plotting data for {parameters}.")
270270

271+
indices_to_remove = []
271272
for i, data in enumerate(alldata):
272273
if len(data) == 2: # 1D PLOTTING
273274
if data[1]["name"] not in parameters:
274-
alldata.pop(i)
275+
indices_to_remove.append(i)
275276
elif len(data) == 3: # 2D PLOTTING
276277
if data[2]["name"] not in parameters:
277-
alldata.pop(i)
278+
indices_to_remove.append(i)
279+
alldata = [d for (i, d) in enumerate(alldata) if i not in indices_to_remove]
278280

279281
for data, ax, colorbar in zip(alldata, axeslist, colorbars):
280282
if len(data) == 2: # 1D PLOTTING

0 commit comments

Comments
 (0)