Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyQtgraph windows are automatically closed if no reference is kept to the plot #647

Closed
jenshnielsen opened this issue Jun 16, 2017 · 0 comments · Fixed by #662
Closed

PyQtgraph windows are automatically closed if no reference is kept to the plot #647

jenshnielsen opened this issue Jun 16, 2017 · 0 comments · Fixed by #662
Labels
Qt Related to Qt-based features

Comments

@jenshnielsen
Copy link
Collaborator

jenshnielsen commented Jun 16, 2017

some like

for i in range(5):
    loop = qc.Loop(dac.ch1.sweep(0, 10, 0.5), delay=0.1).each(dmm.voltage)
    data = loop.get_data_set(name='testsweep')
    plot_1d = qc.QtPlot()  # create a plot
    plot_1d.add(data.dmm_voltage)  # add a graph to the plot
    _ = loop.with_bg_task(plot_1d.update, plot_1d.save).run()  # run the loop

results in all but the latest figure getting closed
but

plots = []
for i in range(5):
    loop = qc.Loop(dac.ch1.sweep(0, 10, 0.5), delay=0.1).each(dmm.voltage)
    data = loop.get_data_set(name='testsweep')
    plot_1d = qc.QtPlot()  # create a plot
    plot_1d.add(data.dmm_voltage)  # add a graph to the plot
    plots.append(plot_1d)
    _ = loop.with_bg_task(plot_1d.update, plot_1d.save).run()  # run the loop

all figures will remain open as a reference is kept to all of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Qt Related to Qt-based features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant