utilitiesClass.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:pslab-desktop-apps 作者: fossasia 项目源码 文件源码
def addCurve(self,plot,name='',**kwargs):
        """
        Add a new curve to a 2D plot

        .. tabularcolumns:: |p{3cm}|p{11cm}|

        ===============  ============================================================================================
        **Arguments** 
        ===============  ============================================================================================
        plot             QPlotWidget created using :func:`add2DPlot`
        name             something to call this trace. Shown in the legend too
        ===============  ============================================================================================

        :return: pyqtgraph.PlotDataItem
        """
        #if(len(name)):curve = pg.PlotDataItem(name=name)
        curve = pg.PlotCurveItem(name = name,**kwargs)
        plot.addItem(curve)
        if self.properties['colorScheme']=='white':
            curve.setPen(kwargs.get('pen',{'color':self.white_trace_colors[len(self.plots2D[plot])],'width':1}))
        elif self.properties['colorScheme']=='black':
            curve.setPen(kwargs.get('pen',{'color':self.black_trace_colors[len(self.plots2D[plot])],'width':1}))
        #print (self.black_trace_colors[len(self.plots2D[plot])] , len(self.plots2D[plot]) )
        self.plots2D[plot].append(curve)
        return curve
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号