Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

scan1D liveplot not updating points #759

Closed
jsaez8 opened this issue Mar 24, 2021 · 5 comments
Closed

scan1D liveplot not updating points #759

jsaez8 opened this issue Mar 24, 2021 · 5 comments

Comments

@jsaez8
Copy link

jsaez8 commented Mar 24, 2021

Hi all!
I'm new using qtt and while measuring with "scan1D" function I realized that the live plot does not work as expected.

I can see how the Y-axis updates, but the points are not shown. I took a look into the code but I didn't find the problem.

This is some dummy code that I wrote to show the problem:

import sys, os, tempfile
import numpy as np
%matplotlib inline
%gui qt
import matplotlib.pyplot as plt
import qcodes
from qcodes.plots.qcmatplotlib import MatPlot
from qcodes.plots.pyqtgraph import QtPlot
from qcodes.data.data_set import DataSet
from qtt.measurements.scans import scanjob_t  
import qtt
from qtt.instrument_drivers.gates import VirtualDAC
from qcodes.tests.instrument_mocks import DummyInstrument, DummyInstrumentWithMeasurement

# set data directory
path_save = r'K:\Jaime\Testing_qtt'
datadir = os.path.join(path_save, 'Test')
DataSet.default_io = qcodes.data.io.DiskIO(datadir)

dac = DummyInstrument('dac', gates=['ch1', 'ch2'])
dmm = DummyInstrumentWithMeasurement(name='dmm', setter_instr=dac)

station = qcodes.Station(dac, dmm)
mwindows = qtt.gui.live_plotting.setupMeasurementWindows(station, create_parameter_widget=False)
plotQ = mwindows['plotwindow']

# Checking the sensor
scanjob = scanjob_t({'sweepdata': dict({'param': station.dac.ch1,
                                        'start': 0.0, 'end': 30.0, 'step':1.0,
                                        'wait_time': 0.1}),
                                        'minstrument': [station.dmm.v1],
                                        'dataset_label': 'Test1D_liveplot'})

data1d = qtt.measurements.scans.scan1D(station, scanjob, liveplotwindow= None,location=None, verbose=0)

Using "scan2D" the updating works without problem, then it is something really particular for the 1D plot.

Could someone help me to solve this issue?
Thanks!
Jaime

@QFer
Copy link
Contributor

QFer commented May 7, 2021

Hi Jaime,
First of all, sorry for the late reply.
I tried to run your code and with a few small adjustments (had to create a QApp first and I changed the path_save to an existing directory on my machine) I run on it on Linux VM. I got the following output (see image). What did you expect differently?

image

Regards,

Fer

@peendebak
Copy link
Contributor

@jsaez8

@jsaez8
Copy link
Author

jsaez8 commented May 17, 2021

Hi,
thanks for the reply. My problem is that it does not update the plot point by point (what I expected that the code would do), it just shows all the points when the measurements are finished. Was this also the case for you?

I ran the code in Windows 10, I don't know if that could be a problem.

Jaime

@QFer
Copy link
Contributor

QFer commented May 21, 2021

@jsaez8
Hi,
In my case it did update point for point. Do you run the example from a jupyter notebook, because I didn't. Maybe that matters. I run qtt 1.2.4 on python 3.7.5.

Fer

@jsaez8
Copy link
Author

jsaez8 commented May 28, 2021

Hi, it seems that the problem was running it in a jupyter notebook. Thank you!

Jaime

@jsaez8 jsaez8 closed this as completed May 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants