当前位置: 首页>>代码示例>>Python>>正文


Python FigureCanvasGTK3Agg.copy_from_bbox方法代码示例

本文整理汇总了Python中matplotlib.backends.backend_gtk3agg.FigureCanvasGTK3Agg.copy_from_bbox方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasGTK3Agg.copy_from_bbox方法的具体用法?Python FigureCanvasGTK3Agg.copy_from_bbox怎么用?Python FigureCanvasGTK3Agg.copy_from_bbox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.backends.backend_gtk3agg.FigureCanvasGTK3Agg的用法示例。


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

示例1: ChessAnalogWindow

# 需要导入模块: from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg [as 别名]
# 或者: from matplotlib.backends.backend_gtk3agg.FigureCanvasGTK3Agg import copy_from_bbox [as 别名]

#.........这里部分代码省略.........
        #self.liststore[31][1] = 18000
        #GObject.timeout_add(200, self.my_timer)
        self.timer_id = None
        self.plot_id = None

        self.f = Figure(figsize=(8,6), dpi=100)
        self.a = self.f.add_subplot(111)
        
        #self.line, = self.a.plot([], [], marker = 'x')
        #self.line, = self.a.plot([], [])
        #self.plt = self.a.plot([0, 1], [0, 3], marker = 'x')
        self.a.xaxis.set_animated(True)
        self.a.yaxis.set_animated(True)

        #self.a.set_xlim([0,5])
        self.a.set_xlim([self.fifo_size/SCAN_FREQ, 0])
        
        self.a.set_ylim([0,70000])
        
        self.a.grid(True)
        #self.a.set_xscale('log')
        #self.a.set_xlim((10.0, 30000.0))
        #self.a.set_ylim((-90.0, 3.0))
        self.a.set_xlabel("Time")
        self.a.set_ylabel("Voltage")

        self.lastx = 0
        self.my_line, = self.a.plot([], [], animated = True)
        self.my_line2, = self.a.plot([], [], animated = True)
        
        self.canvas = FigureCanvas(self.f)

        # Clean background
        self.clean_bg = self.canvas.copy_from_bbox(self.f.bbox)
        self.background = self.canvas.copy_from_bbox(self.get_bg_bbox(self.a))

        self.old_size = self.a.bbox.width, self.a.bbox.height

        self.canvas.draw()

        self.do_redraw = False

        #self.plot_timer = self.canvas.new_timer(interval = 42)

        # self.anim = ma.FuncAnimation(self.f, 
        #                              self.update_plots, 
        #                              event_source = self.plot_timer, 
        #                              init_func = self.init_blit_plot, 
        #                              repeat = False,
        #                              blit = True)

        #print(dir(self.anim))
        #self.anim._stop()
        #self.plot_timer.stop()
        self.master_hbox.pack_start(self.canvas, True, True, 0)
        #self.plot_timer.stop()

        self.connect("check-resize", self.win_resize)

    def acquire_cb(self, state):
        #print("acq callback")
        #print(state)
        if (self.action_acq.get_active()):
            # This is commented because it seems that comedi_cancel()
            # clears stale data in the fd and card?
            #data = os.read(self.fd, BUF_SIZE)
开发者ID:cosmonaut,项目名称:chess_analog_daq,代码行数:70,代码来源:analog_daq.py


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