• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python pyqtgraph.plot函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyqtgraph.plot函数的典型用法代码示例。如果您正苦于以下问题:Python plot函数的具体用法?Python plot怎么用?Python plot使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了plot函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: plot_trace

def plot_trace(xy, ids = None, depth = 0, colormap = 'rainbow', line_color = 'k', line_width = 1, point_size = 5, title = None):
  """Plot trajectories with positions color coded according to discrete ids"""
  
  #if ids is not None:
  uids = np.unique(ids);
  
  cmap = cm.get_cmap(colormap);
  n = len(uids);
  colors = cmap(range(n), bytes = True);
  
  #lines
  if line_width is not None:
    #plt.plot(xy[:,0], xy[:,1], color = lines);    
    plot = pg.plot(xy[:,0], xy[:,1], pen = pg.mkPen(color = line_color, width = line_width))    
  else:
    plot = pg.plot(title = title);
    
  if ids is None:
    sp = pg.ScatterPlotItem(pos = xy, size=point_size, pen=pg.mkPen(colors[0])); #, pxMode=True);
  else:
    sp = pg.ScatterPlotItem(size=point_size); #, pxMode=True);
    spots = [];
    for j,i in enumerate(uids):
      idx = ids == i;
      spots.append({'pos': xy[idx,:].T, 'data': 1, 'brush':pg.mkBrush(colors[j])}); #, 'size': point_size});
    sp.addPoints(spots)
  
  plot.addItem(sp);
  
  return plot;
开发者ID:ChristophKirst,项目名称:CElegansBehaviour,代码行数:30,代码来源:plot.py


示例2: plotAll

def plotAll(f):
    """plot all arrays in file f (code reference)"""
    for g in f.walkGroups():
        print(g)
        for arr in f.listNodes(g, classname='Array'):
            if arr.ndim == 1 and arr.shape[0] > 1:
                pg.plot(arr.read())
开发者ID:jerasky,项目名称:plotting-programs,代码行数:7,代码来源:kplot.py


示例3: simplePlot

def simplePlot():
    data = np.random.normal(size=1000)
    pg.plot(data, title="Simplest possible plotting example")

    data = np.random.normal(size=(500,500))
    pg.image(data, title="Simplest possible image example")
    pg.QtGui.QApplication.exec_()
开发者ID:profjrr,项目名称:OETC2014_PythonInClassroom_ProfJRR,代码行数:7,代码来源:Mod2Run2.py


示例4: plotPower

 def plotPower(fftData, N, C, F):
   v = np.absolute(np.fft.fftshift(fftData) / N)
   sqV = v * v
   p = sqV / 50.0 * 1000 * 2 # * 2 is made to take care of the fact that FFT is two-sided
   pdBm = np.log10(p) * 10
   print "max = %f" % np.max(pdBm)
   print "avg = %f" % np.average(pdBm)
   #pg.plot(np.linspace(-Fs/2, Fs/2 - Fs / N, N), pdBm)
   s1 = N/2 + N * F / Fs - N * 1000000 / Fs
   s2 = N/2 + N * F / Fs + N * 1000000 / Fs
   pg.plot(pdBm[int(s1):int(s2)])
开发者ID:rinatzakirov,项目名称:vhdl,代码行数:11,代码来源:ddr_analyze.py


示例5: plotHist

    def plotHist(self, regions = None):

        '''Usage: plotHist(region = None)

        region(int): Region to be plotted. If None, plots all regions.

        Plots the current ratio histograms for the regions.

        *** Does not need event type update. *** '''

        if regions == None:

            # Plot all regions

            print "Plotting ratio histogram for all regions...\n"

            histPlot = pg.plot(title = "Ratio Histograms")
            histPlot.addLegend()

            histPlot.setLabel('left',"Counts")
            histPlot.setLabel('bottom',"Ratio")

            for i,hist in enumerate(self.rhist):

                histName = "  Region " + str(i)
                histPlot.plot(hist, pen=(i,len(self.rhist)), name=histName)

            import sys
            if(sys.flags.interactive != 1) or not hasattr(QtCore,
                                                          'PYQT_VERSION'):
                QtGui.QApplication.instance().exec_()

        else:

            # Plot the region listed

            print "Plotting ratio histogram for region", regions, "...\n"

            histPlot = pg.plot(title = "Ratio Histogram")
            histPlot.addLegend()

            histPlot.setLabel('left',"Counts")
            histPlot.setLabel('bottom',"Ratio")

            for i,region in enumerate(regions):

                histName = "  Region " + str(region)
                histPlot.plot(self.rhist[region,:],pen=(i,len(regions)),
                              name=histName)

            import sys
            if(sys.flags.interactive != 1) or not hasattr(QtCore,
                                                          'PYQT_VERSION'):
                QtGui.QApplication.instance().exec_()
开发者ID:appriest,项目名称:proximity,代码行数:54,代码来源:calibrationClass.py


示例6: _executeRun

    def _executeRun(self, testPlot=False):
        """
        (private mmethod)
        After prepare run and initialization, this routine actually calls the run method in hoc
        assembles the data, saves it to disk and plots the results.
        Inputs: flag to put up a test plot....
        """
        if verbose:
            print('_executeRun')
        assert self.run_initialized == True
        print('Starting Vm at electrode site: {:6.2f}'.format(self.electrode_site.v))
        
        # one way
        self.hf.h.t = 0
        """
        #while (self.hf.h.t < self.hf.h.tstop):
        #    for i=0, tstep/dt {
        #       self.hf.h.fadvance()
        # self.hf.h.run()  # calls finitialize, causes offset
        """
        self.hf.h.batch_save() # save nothing
        print ('Temperature in run at start: {:6.1f}'.format(self.hf.h.celsius))
        self.hf.h.batch_run(self.hf.h.tstop, self.hf.h.dt, "v.dat")
        print('Finishing Vm: {:6.2f}'.format(self.electrode_site.v))
        self.monitor['time'] = np.array(self.monitor['time'])
        self.monitor['time'][0] = 0.
        if verbose:
            print('post v: ', self.monitor['postsynapticV'])
        if testPlot:
           pg.plot(np.array(self.monitor['time']), np.array(self.monitor['postsynapticV']))
           QtGui.QApplication.instance().exec_()
           # pg.mkQApp()
            # pl = pg.plot(np.array(self.monitor['time']), np.array(self.monitor['postsynapticV']))
            # if self.filename is not None:
            #     pl.setTitle('%s' % self.filename)
            # else:
            #     pl.setTitle('executeRun, no filename')
        print ('    Run finished')
        np_monitor = {}
        for k in self.monitor.keys():
            np_monitor[k] = np.array(self.monitor[k])

        np_allsecVec = OrderedDict()
        for k in self.allsecVec.keys():
            np_allsecVec[k] = np.array(self.allsecVec[k])
        self.runInfo.clist = self.clist
        results = Params(Sections=list(self.hf.sections.keys()),  vec=np_allsecVec,
                         monitor=np_monitor, stim=self.stim, runInfo=self.runInfo,
                         distanceMap = self.hf.distanceMap,
        )
        if verbose:
            print('    _executeRun completed')
        return results
开发者ID:pbmanis,项目名称:VCNModel,代码行数:53,代码来源:generate_run.py


示例7: simplePlot

def simplePlot():
    data = np.random.normal(size=1000)
    pg.plot(data, title="Simplest possible plotting example")

    data = np.random.normal(size=(500,500))
    pg.image(data, title="Simplest possible image example")

    ## Start Qt event loop unless running in interactive mode or using pyside.
    if __name__ == '__main__':
        import sys
        if sys.flags.interactive != 1 or not hasattr(QtCore, 'PYQT_VERSION'):
            pg.QtGui.QApplication.exec_()
开发者ID:profjrr,项目名称:OETC2014_PythonInClassroom_ProfJRR,代码行数:12,代码来源:Mod2Run1.py


示例8: __init__

    def __init__(self):
        # start a pyqtgraph application (sigh...)
        self.buffer_depth = 1000
        
        # Always start by initializing Qt (only once per application)
        app = QtGui.QApplication([])

        # powerstack
        self.powerstack_init = True
        self.xray_power   = collections.deque(maxlen = self.buffer_depth)
        
        self.plt_powerstack = pg.PlotItem(title = 'xray power vs event')
        self.w_powerstack = pg.ImageView(view = self.plt_powerstack)
            
        bottom = self.plt_powerstack.getAxis('bottom')
        bottom.setLabel('delay (fs)')

        left = self.plt_powerstack.getAxis('left')
        left.setLabel('event number ')

        # power vs delay
        self.w_xray_power = pg.plot(title = 'xray power vs delay')
        self.w_xray_power.setLabel('bottom', 'delay (fs)')
        self.w_xray_power.setLabel('left', 'power (GW)')

        # delay
        self.delay        = collections.deque(maxlen = self.buffer_depth)
        self.event_number = collections.deque(maxlen = self.buffer_depth)
        self.w_delay = pg.plot(title = 'time between the two xray pulses')
        self.w_delay.setLabel('bottom', 'event')
        self.w_delay.setLabel('left', 'delay (fs)')

        # xtcav images
        self.plt_xtcav  = pg.PlotItem(title = 'processed xtcav image')
        self.xtcav_init = True
        self.w_xtcav = pg.ImageView(view = self.plt_xtcav)

        bottom = self.plt_xtcav.getAxis('bottom')
        bottom.setLabel('delay (fs)')

        left = self.plt_xtcav.getAxis('left')
        left.setLabel('electron energy (MeV)')

        ## Start the Qt event loop
        signal.signal(signal.SIGINT, signal.SIG_DFL)    # allow Control-C
        
        self.catch_data()

        sys.exit(app.exec_())
开发者ID:andyofmelbourne,项目名称:SLAC-scripts,代码行数:49,代码来源:xtcav_gui.py


示例9: plotbar

def plotbar(arrY, x=None, color=None, hold=None, figureNo=None, width=0.6):
    global CURR, PLOTS
    arrY = N.asarray( arrY )
    
    if x is not None:
        x = N.asarray(x)
    else:
        x = N.arange(arrY.shape[-1])
        
    if len(arrY.shape) > 1 and arrY.shape[0] >  arrY.shape[1]:
        arrY = N.transpose(arrY)

    pw = plothold(hold, figureNo)
    append = pw == pg
    if append:
        pw = pg.plot()

    kwd = {}
    kwd['pen'] = _pen(pw, color)
    kwd['brush'] = _brush(pw, color)
    kwd['width'] = width
    

    if len(arrY.shape) == 1:
        bg = pg.BarGraphItem(x=x, height=arrY, **kwd)
        pw.addItem(bg)
    else:
        data = []
        for i in range(arr.shape[0]):
            bg = pg.BarGraphItem(x=x, height=arrY[i], **kwd)
            pw.addItem(bg)
            
    if append:
        PLOTS.append(pw)
开发者ID:macronucleus,项目名称:Chromagnon,代码行数:34,代码来源:usefulP3.py


示例10: plot

    def plot(self, Rs=None, Vg=0):
        pg.setConfigOption('background', 'w')
        pg.setConfigOption('foreground', 'k')

        # Generate plot
        plt = pg.plot(title=self.__class__.__name__, clear=True)
        plt.setYRange(0, self.IDSS_MAX)
        plt.setXRange(self.VP_MAX, 0)
        plt.showGrid(True, True, 1.0)
        plt.setLabel('left', "Id (mA)")
        plt.setLabel('bottom', "Vgs (V)")

        (x, y) = self.id_max_points()
        plt.plot(x, y, pen=pg.mkPen('g', width=3))

        (x, y) = self.id_min_points()
        plt.plot(x, y, pen=pg.mkPen('b', width=3))

        if Rs is not None:
            (x, y) = self.vg_intercept(Rs, Vg)
            plt.plot(x, y, pen=pg.mkPen('r', width=3))

        # Display plot
        QtGui.QApplication.instance().exec_()
        pg.exit()
开发者ID:devttys0,项目名称:EE,代码行数:25,代码来源:jfet.py


示例11: show_fft

	def show_fft(self):
		for ch in range(4):
			if self.chanStatus[ch] == 1:
				try:	
					fa = em.fit_sine(self.timeData[ch],self.voltData[ch])
				except Exception as err:
					print('fit_sine error:', err)
					fa=None
				if fa != None:
					fr = fa[1][1]*1000			# frequency in Hz
					dt = int(1.e6/ (20 * fr))	# dt in usecs, 20 samples per cycle
					try:
						t,v = self.p.capture1(self.sources[ch], 3000, dt)
					except:
						self.comerr()

					xa,ya = em.fft(v,dt)
					xa *= 1000
					peak = self.peak_index(xa,ya)
					ypos = np.max(ya)
					pop = pg.plot(xa,ya, pen = self.traceCols[ch])
					pop.showGrid(x=True, y=True)
					txt = pg.TextItem(text=unicode(self.tr('Fundamental frequency = %5.1f Hz')) %peak, color = 'w')
					txt.setPos(peak, ypos)
					pop.addItem(txt)
					pop.setWindowTitle(self.tr('Frequency Spectrum'))
				else:
					self.msg(self.tr('FFT Error'))
开发者ID:expeyes,项目名称:expeyes-programs,代码行数:28,代码来源:scope.py


示例12: estimate_kinetics

    def estimate_kinetics(self, plot=False):
        kinetics_group = self.kinetics_group
        
        # Generate average decay phase
        avg_kinetic = kinetics_group.bsub_mean()
        avg_kinetic.t0 = 0
        
        if plot:
            kin_plot = pg.plot(title='Kinetics')
            kin_plot.plot(avg_kinetic.time_values, avg_kinetic.data)
        else:
            kin_plot = None
        
        # Make initial kinetics estimate
        amp_est = self._psp_estimate['amp']
        amp_sign = '-' if amp_est < 0 else '+'
        kin_fit = fit_psp(avg_kinetic, sign=amp_sign, yoffset=0, amp=amp_est, method='leastsq', fit_kws={})
        if plot:
            kin_plot.plot(avg_kinetic.time_values, kin_fit.eval(), pen='b')
        rise_time = kin_fit.best_values['rise_time']
        decay_tau = kin_fit.best_values['decay_tau']
        latency = kin_fit.best_values['xoffset'] - 10e-3

        self._psp_estimate['rise_time'] = rise_time
        self._psp_estimate['decay_tau'] = decay_tau
        self._psp_estimate['latency'] = latency
        
        return rise_time, decay_tau, latency, kin_plot
开发者ID:corinneteeter,项目名称:multipatch_analysis,代码行数:28,代码来源:synaptic_dynamics.py


示例13: estimate_amplitude

    def estimate_amplitude(self, plot=False):
        amp_group = self.amp_group
        amp_est = None
        amp_plot = None
        amp_sign = None
        avg_amp = None
        n_sweeps = len(amp_group)
        if n_sweeps == 0:
            return amp_est, amp_sign, avg_amp, amp_plot, n_sweeps
        # Generate average first response
        avg_amp = amp_group.bsub_mean()
        if plot:
            amp_plot = pg.plot(title='First pulse amplitude')
            amp_plot.plot(avg_amp.time_values, avg_amp.data)

        # Make initial amplitude estimate
        ad = avg_amp.data
        dt = avg_amp.dt
        base = float_mode(ad[:int(10e-3/dt)])
        neg = ad[int(13e-3/dt):].min() - base
        pos = ad[int(13e-3/dt):].max() - base
        amp_est = neg if abs(neg) > abs(pos) else pos
        if plot:
            amp_plot.addLine(y=base + amp_est)
        amp_sign = '-' if amp_est < 0 else '+'
        
        self._psp_estimate['amp'] = amp_est
        self._psp_estimate['amp_sign'] = amp_sign
        
        return amp_est, amp_sign, avg_amp, amp_plot, n_sweeps
开发者ID:corinneteeter,项目名称:multipatch_analysis,代码行数:30,代码来源:synaptic_dynamics.py


示例14: ShowGraph

 def ShowGraph(self):
     """        
     app = QtGui.QApplication(sys.argv)
     widget = pg.PlotWidget(title="Stock Performance")
     widget.setWindowTitle("Graph")
     widget.plotItem.plot(floatStockClosePrice)
     """        
     ticker = str(self.lineEdit.text())
     if self.radioButton_3.isChecked() or self.radioButton_4.isChecked() and ticker in theTickers:
         
         widget = pg.plot(floatStockClosePrice, title="Graph")       
             
         ax = widget.getPlotItem().getAxis("left")
         ax.setLabel("Price")
         ax.setGrid(200)
         ax.showLabel()
         
         ax = widget.getPlotItem().getAxis("bottom")
         ax.setLabel("Year")
         ax.setGrid(200)
         ax.showLabel()
             
         widget.show()           
     
     else:
         Tkinter.Tk().withdraw()
         tkMessageBox.showerror("Error: Stock Not Found", "Please try again and click 'See Projection' for graph to show.")
开发者ID:Logic864,项目名称:School_Work,代码行数:27,代码来源:officialgui.py


示例15: test_lag1st_to_trig

    def test_lag1st_to_trig(self):
        # scalar case
        dest_weight = core.change_projection_base(self.src_weights, self.src_test_funcs, self.trig_test_funcs[0])
        dest_approx_handle_s = core.back_project_from_base(dest_weight, self.trig_test_funcs[0])

        # standard case
        dest_weights = core.change_projection_base(self.src_weights, self.src_test_funcs, self.trig_test_funcs)
        dest_approx_handle = core.back_project_from_base(dest_weights, self.trig_test_funcs)
        error = np.sum(np.power(
            np.subtract(self.real_func_handle(self.z_values), dest_approx_handle(self.z_values)),
            2))

        if show_plots:
            pw = pg.plot(title="change projection base")
            i1 = pw.plot(x=self.z_values, y=self.real_func_handle(self.z_values), pen="r")
            i2 = pw.plot(x=self.z_values, y=self.src_approx_handle(self.z_values),
                         pen=pg.mkPen("g", style=pg.QtCore.Qt.DashLine))
            i3 = pw.plot(x=self.z_values, y=dest_approx_handle_s(self.z_values), pen="b")
            i4 = pw.plot(x=self.z_values, y=dest_approx_handle(self.z_values), pen="c")
            legend = pw.addLegend()
            legend.addItem(i1, "f(x) = x")
            legend.addItem(i2, "2x Lagrange1st")
            legend.addItem(i3, "sin(x)")
            legend.addItem(i4, "sin(wx) with w in [1, {0}]".format(dest_weights.shape[0]))
            app.exec_()

        # should fit pretty nice
        self.assertLess(error, 1e-2)
开发者ID:rihe,项目名称:pyinduct,代码行数:28,代码来源:test_core.py


示例16: draw_spectrum_analyzer

	def draw_spectrum_analyzer(all_frames, thresh_frames):
		time.sleep(1) # Wait just one second
		pw = pg.plot(title="Spectrum Analyzer") # Window title
		pg.setConfigOptions(antialias=True) # Enable antialias for better resolution
		pw.win.resize(800, 300) # Define window size
		pw.win.move(540 * SCREEN_WIDTH / 1920, 500 * SCREEN_HEIGHT / 1080) # Define window position
		while True: # Loop over the frames of the audio / data chunks
			data = ''.join(all_frames[-1:]) # Get only the last frame of all frames
			data = numpy.fromstring(data, 'int16') # Binary string to numpy int16 data format
			pw.setMouseEnabled(y=False) # Disable mouse
			pw.setYRange(0,1000) # Set Y range of graph
			pw.setXRange(-(RATE/16), (RATE/16), padding=0) # Set X range of graph relative to Bit Rate
			pwAxis = pw.getAxis("bottom") # Get bottom axis
			pwAxis.setLabel("Frequency [Hz]") # Set bottom axis label
			f, Pxx = HearingPerception.find_frequency(data) # Call find frequency function
			f = f.tolist() # Numpy array to list
			Pxx = (numpy.absolute(Pxx)).tolist() # Numpy array to list
			try: # Try this block
				if thresh_frames[-1:][0] == EMPTY_CHUNK: # If last thresh frame is equal to EMPTY CHUNK
					pw.plot(x=f,y=Pxx, clear=True, pen=pg.mkPen('w', width=1.0, style=QtCore.Qt.SolidLine)) # Then plot with white pen
				else: # If last thresh frame is not equal to EMPTY CHUNK
					pw.plot(x=f,y=Pxx, clear=True, pen=pg.mkPen('y', width=1.0, style=QtCore.Qt.SolidLine)) # Then plot with yellow pen
			except IndexError: # If we are getting an IndexError because of this -> thresh_frames[-1:][0]
				pw.plot(x=f,y=Pxx, clear=True, pen=pg.mkPen('w', width=1.0, style=QtCore.Qt.SolidLine)) # Then plot with white pen
			pg.QtGui.QApplication.processEvents() # ???
			time.sleep(0.05) # Wait a few miliseconds
开发者ID:Unmukt,项目名称:Cerebrum,代码行数:26,代码来源:perception.py


示例17: stream

def stream(update_interval, filter_width, max_samples):
    """Continuously acquires low fluid pressure sensor signal, filters it, and plots it live."""
    # Plotting
    graph = pg.plot()
    graph.addLegend()
    signal_curve = graph.plot(pen='r', name="Raw (Noisy) Signal")
    filtered_curve = graph.plot(pen='b', name="Median Filtered Signal")

    signal_curve_updater = plotting.CurveUpdater.start(signal_curve, max_samples)

    filtered_curve_updater = plotting.CurveUpdater.start(filtered_curve, max_samples)
    signal_filter = signal.Filterer.start(filter_width=filter_width)
    signal_filter.proxy().register(filtered_curve_updater, 'fluid pressure')

    pressure_selector = signal.TupleSelector.start(0)
    pressure_selector.proxy().register(signal_curve_updater, 'fluid pressure')
    pressure_selector.proxy().register(signal_filter, 'fluid pressure')

    try:
        leg_monitor = leg.LegMonitor.start()
    except RuntimeError:
        pykka.ActorRegistry.stop_all() # stop actors in LIFO order
        raise
    leg_monitor.proxy().register(pressure_selector, 'fluid pressure')
    leg_monitor.tell({'command': 'start producing', 'interval': update_interval})
开发者ID:lietk12,项目名称:vera-sleeve,代码行数:25,代码来源:filtered_fluid_sensor.py


示例18: test_projection_on_lag1st

    def test_projection_on_lag1st(self):
        weights = []

        # convenience wrapper for non array input -> constant function
        weight = core.project_on_base(self.funcs[0], self.initial_functions[1])
        self.assertAlmostEqual(weight, 1.5*self.funcs[0](self.nodes[1]))

        # linear function -> should be fitted exactly
        weights.append(core.project_on_base(self.funcs[1], self.initial_functions))
        self.assertTrue(np.allclose(weights[-1], self.funcs[1](self.nodes)))

        # quadratic function -> should be fitted somehow close
        weights.append(core.project_on_base(self.funcs[2], self.initial_functions))
        self.assertTrue(np.allclose(weights[-1], self.funcs[2](self.nodes), atol=.5))

        # trig function -> will be crappy
        weights.append(core.project_on_base(self.funcs[3], self.initial_functions))

        if show_plots:
            # since test function are lagrange1st order, plotting the results is fairly easy
            for idx, w in enumerate(weights):
                pw = pg.plot(title="Weights {0}".format(idx))
                pw.plot(x=self.z_values, y=self.real_values[idx+1], pen="r")
                pw.plot(x=self.nodes, y=w, pen="b")
                app.exec_()
开发者ID:rihe,项目名称:pyinduct,代码行数:25,代码来源:test_core.py


示例19: test_CSVExporter

def test_CSVExporter():
    plt = pg.plot()
    y1 = [1,3,2,3,1,6,9,8,4,2]
    plt.plot(y=y1, name='myPlot')
    
    y2 = [3,4,6,1,2,4,2,3,5,3,5,1,3]
    x2 = pg.np.linspace(0, 1.0, len(y2))
    plt.plot(x=x2, y=y2)
    
    y3 = [1,5,2,3,4,6,1,2,4,2,3,5,3]
    x3 = pg.np.linspace(0, 1.0, len(y3)+1)
    plt.plot(x=x3, y=y3, stepMode=True)
    
    ex = pg.exporters.CSVExporter(plt.plotItem)
    ex.export(fileName='test.csv')

    r = csv.reader(open('test.csv', 'r'))
    lines = [line for line in r]
    header = lines.pop(0)
    assert header == ['myPlot_x', 'myPlot_y', 'x0001', 'y0001', 'x0002', 'y0002']
    
    i = 0
    for vals in lines:
        vals = list(map(str.strip, vals))
        assert (i >= len(y1) and vals[0] == '') or approxeq(float(vals[0]), i) 
        assert (i >= len(y1) and vals[1] == '') or approxeq(float(vals[1]), y1[i]) 
        
        assert (i >= len(x2) and vals[2] == '') or approxeq(float(vals[2]), x2[i])
        assert (i >= len(y2) and vals[3] == '') or approxeq(float(vals[3]), y2[i])
        
        assert (i >= len(x3) and vals[4] == '') or approxeq(float(vals[4]), x3[i])
        assert (i >= len(y3) and vals[5] == '') or approxeq(float(vals[5]), y3[i])
        i += 1
开发者ID:AeroEng43,项目名称:pyqtgraph,代码行数:33,代码来源:test_csv.py


示例20: summary_plot_train

def summary_plot_train(ind_grand_mean, plot=None, color=None, name=None):
    if plot is None:
        plot = pg.plot()
        plot.setLabels(left=('Vm', 'V'))
        plot.addLegend()

    plot.plot(ind_grand_mean.time_values, ind_grand_mean.data, pen=color, name=name)
    return plot
开发者ID:corinneteeter,项目名称:multipatch_analysis,代码行数:8,代码来源:synapse_comparison.py



注:本文中的pyqtgraph.plot函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pyqtgraph.setConfigOption函数代码示例发布时间:2022-05-27
下一篇:
Python pyqtgraph.mkQApp函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap