本文整理匯總了Python中Plotter.Plotter.addPlotItem方法的典型用法代碼示例。如果您正苦於以下問題:Python Plotter.addPlotItem方法的具體用法?Python Plotter.addPlotItem怎麽用?Python Plotter.addPlotItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Plotter.Plotter
的用法示例。
在下文中一共展示了Plotter.addPlotItem方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import addPlotItem [as 別名]
def main():
plotter = Plotter("out.png", "The plot", "some", "thing", 10, 60)
plotter.addPlotItem("Source1", "#F01020", dataSource1)
plotter.addPlotItem("Source2", "#201020", dataSource2)
#plotter.begin()
stopEvent = threading.Event()
tweeter = TwitterPlotBot('api/app key', 'api/app secret',
'access key',
'access secret',
'#pause', '#resume', plotter, stopEvent, '@navin_bhaskar', 500, False)
time.sleep(120)
print "Plotting..."
tweeter.start()
time.sleep(1900)
print "Stopping it....."
stopEvent.set()
tweeter.join()
示例2: main
# 需要導入模塊: from Plotter import Plotter [as 別名]
# 或者: from Plotter.Plotter import addPlotItem [as 別名]
def main():
""" This is the enrty point for our application,
"TwitterBot" """
global plotter
plotter = Plotter(config.config["output file"], # The output file name
config.config["title"], # Title of the plot
config.config["xlabel"], # X axis label
config.config["ylabel"], # Y axis label
config.config["samples"], # Max number of samples to be taken
config.config["Log Interval"], # Log interval
)
# Now that we have the plotter, it is time to add items to it
for callback in CallBacks.callbacks:
plotter.addPlotItem(callback[0], callback[2], callback[1])
twitterBot = TwitterPlotBot(config.config["consumer key"],
config.config["consumer secret"],
config.config["access token"],
config.config["access token secret"],
config.config["stop plot cmd"],
config.config["resume plot cmd"],
plotter,
stopEvent,
config.config["screen id"],
config.config["Tweet Interval"],
False)
# Wait for some time until we have atleast one data point to plot
time.sleep(config.config["Log Interval"])
twitterBot.start()
while True:
pass