本文整理匯總了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
示例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
示例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