當前位置: 首頁>>代碼示例>>Python>>正文


Python arch.Gnuplot方法代碼示例

本文整理匯總了Python中arch.Gnuplot方法的典型用法代碼示例。如果您正苦於以下問題:Python arch.Gnuplot方法的具體用法?Python arch.Gnuplot怎麽用?Python arch.Gnuplot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在arch的用法示例。


在下文中一共展示了arch.Gnuplot方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: multiplot

# 需要導入模塊: import arch [as 別名]
# 或者: from arch import Gnuplot [as 別名]
def multiplot(self, f, lfilter=None, **kargs):
        """Uses a function that returns a label and a value for this label, then plots all the values label by label"""
        g=Gnuplot.Gnuplot()
        l = self.res
        if lfilter is not None:
            l = filter(lfilter, l)

        d={}
        for e in l:
            k,v = f(e)
            if k in d:
                d[k].append(v)
            else:
                d[k] = [v]
        data=[]
        for k in d:
            data.append(Gnuplot.Data(d[k], title=k, **kargs))

        g.plot(*data)
        return g 
開發者ID:medbenali,項目名稱:CyberScan,代碼行數:22,代碼來源:plist.py

示例2: plot

# 需要導入模塊: import arch [as 別名]
# 或者: from arch import Gnuplot [as 別名]
def plot(self, f, lfilter=None,**kargs):
        """Applies a function to each packet to get a value that will be plotted with GnuPlot. A gnuplot object is returned
        lfilter: a truth function that decides whether a packet must be ploted"""
        g=Gnuplot.Gnuplot()
        l = self.res
        if lfilter is not None:
            l = filter(lfilter, l)
        l = map(f,l)
        g.plot(Gnuplot.Data(l, **kargs))
        return g 
開發者ID:medbenali,項目名稱:CyberScan,代碼行數:12,代碼來源:plist.py

示例3: diffplot

# 需要導入模塊: import arch [as 別名]
# 或者: from arch import Gnuplot [as 別名]
def diffplot(self, f, delay=1, lfilter=None, **kargs):
        """diffplot(f, delay=1, lfilter=None)
        Applies a function to couples (l[i],l[i+delay])"""
        g = Gnuplot.Gnuplot()
        l = self.res
        if lfilter is not None:
            l = filter(lfilter, l)
        l = map(f,l[:-delay],l[delay:])
        g.plot(Gnuplot.Data(l, **kargs))
        return g 
開發者ID:medbenali,項目名稱:CyberScan,代碼行數:12,代碼來源:plist.py


注:本文中的arch.Gnuplot方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。