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


Python FigureCanvasBase.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
    def __init__(self, figure):
        if _debug: print('FigureCanvasGTK3.%s' % fn_name())
        FigureCanvasBase.__init__(self, figure)
        GObject.GObject.__init__(self)

        self._idle_draw_id  = 0
        self._need_redraw   = True
        self._lastCursor    = None

        self.connect('scroll_event',         self.scroll_event)
        self.connect('button_press_event',   self.button_press_event)
        self.connect('button_release_event', self.button_release_event)
        self.connect('configure_event',      self.configure_event)
        self.connect('draw',                 self.on_draw_event)
        self.connect('key_press_event',      self.key_press_event)
        self.connect('key_release_event',    self.key_release_event)
        self.connect('motion_notify_event',  self.motion_notify_event)
        self.connect('leave_notify_event',   self.leave_notify_event)
        self.connect('enter_notify_event',   self.enter_notify_event)
        self.connect('size_allocate',        self.size_allocate)

        self.set_events(self.__class__.event_mask)

        self.set_double_buffered(True)
        self.set_can_focus(True)
        self._renderer_init()
        self._idle_event_id = GLib.idle_add(self.idle_event)
        default_context = GLib.main_context_get_thread_default() or GLib.main_context_default()
        self._idle_event_source = default_context.find_source_by_id(self._idle_event_id)
开发者ID:7924102,项目名称:matplotlib,代码行数:31,代码来源:backend_gtk3.py

示例2: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
    def __init__(self, figure):
        FigureCanvasBase.__init__(self, figure)
        GObject.GObject.__init__(self)

        self._idle_draw_id  = 0
        self._lastCursor    = None

        self.connect('scroll_event',         self.scroll_event)
        self.connect('button_press_event',   self.button_press_event)
        self.connect('button_release_event', self.button_release_event)
        self.connect('configure_event',      self.configure_event)
        self.connect('draw',                 self.on_draw_event)
        self.connect('key_press_event',      self.key_press_event)
        self.connect('key_release_event',    self.key_release_event)
        self.connect('motion_notify_event',  self.motion_notify_event)
        self.connect('leave_notify_event',   self.leave_notify_event)
        self.connect('enter_notify_event',   self.enter_notify_event)
        self.connect('size_allocate',        self.size_allocate)

        self.set_events(self.__class__.event_mask)

        self.set_double_buffered(True)
        self.set_can_focus(True)
        self._renderer_init()
        default_context = GLib.main_context_get_thread_default() or GLib.main_context_default()
开发者ID:Carreau,项目名称:matplotlib,代码行数:27,代码来源:backend_gtk3.py

示例3: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
    def __init__(self, figure):
        if _debug: print 'FigureCanvasGTK3.%s' % fn_name()
        FigureCanvasBase.__init__(self, figure)
        GObject.GObject.__init__(self)

        self._idle_draw_id  = 0
        self._need_redraw   = True
        self._lastCursor    = None

        self.connect('scroll_event',         self.scroll_event)
        self.connect('button_press_event',   self.button_press_event)
        self.connect('button_release_event', self.button_release_event)
        self.connect('configure_event',      self.configure_event)
        self.connect('draw',                 self.on_draw_event)
        self.connect('key_press_event',      self.key_press_event)
        self.connect('key_release_event',    self.key_release_event)
        self.connect('motion_notify_event',  self.motion_notify_event)
        self.connect('leave_notify_event',   self.leave_notify_event)
        self.connect('enter_notify_event',   self.enter_notify_event)

        self.set_events(self.__class__.event_mask)

        self.set_double_buffered(True)
        self.set_can_focus(True)
        self._renderer_init()
        self._idle_event_id = GObject.idle_add(self.idle_event)
开发者ID:JackKelly,项目名称:matplotlib,代码行数:28,代码来源:backend_gtk3.py

示例4: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
    def __init__(self, figure):
        if _debug: print 'FigureCanvasGTK.%s' % fn_name()
        FigureCanvasBase.__init__(self, figure)
        gtk.DrawingArea.__init__(self)

        self._idle_draw_id  = 0
        self._need_redraw   = True
        self._pixmap_width  = -1
        self._pixmap_height = -1
        self._lastCursor    = None

        self.connect('scroll_event',         self.scroll_event)
        self.connect('button_press_event',   self.button_press_event)
        self.connect('button_release_event', self.button_release_event)
        self.connect('configure_event',      self.configure_event)
        self.connect('expose_event',         self.expose_event)
        self.connect('key_press_event',      self.key_press_event)
        self.connect('key_release_event',    self.key_release_event)
        self.connect('motion_notify_event',  self.motion_notify_event)
        self.connect('leave_notify_event',   self.leave_notify_event)
        self.connect('enter_notify_event',   self.enter_notify_event)

        self.set_events(self.__class__.event_mask)

        self.set_double_buffered(False)
        self.set_flags(gtk.CAN_FOCUS)
        self._renderer_init()

        self._idle_event_id = gobject.idle_add(self.idle_event)
开发者ID:AndreI11,项目名称:SatStressGui,代码行数:31,代码来源:backend_gtk.py

示例5: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
    def __init__( self, figure ):
        if DEBUG: print('FigureCanvasQt: ', figure)
        _create_qApp()

        QtGui.QWidget.__init__( self )
        FigureCanvasBase.__init__( self, figure )
        self.figure = figure
        self.setMouseTracking( True )
        self._idle = True
        # hide until we can test and fix
        #self.startTimer(backend_IdleEvent.milliseconds)
        w,h = self.get_width_height()
        self.resize( w, h )

        # JDH: Note the commented out code below does not work as
        # expected, because according to Pierre Raybaut, The reason is
        # that PyQt fails (silently) to call a method of this object
        # just before detroying it. Using a lambda function will work,
        # exactly the same as using a function (which is not bound to
        # the object to be destroyed).
        #
        #QtCore.QObject.connect(self, QtCore.SIGNAL('destroyed()'),
        #    self.close_event)
        QtCore.QObject.connect(self, QtCore.SIGNAL('destroyed()'),
                               lambda: self.close_event())
开发者ID:chrishowes,项目名称:matplotlib,代码行数:27,代码来源:backend_qt4.py

示例6: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
    def __init__(self, figure):
        FigureCanvasBase.__init__(self, figure)
        # print "Init of Canvas called....",figure
        self.frame_count = 0
        global figure_number
        self.figure_number = figure_number
        figure_number += 1
        self._clients = set()
        self._frame = None
        self._header = ""
        self._home_x = {}
        self._home_y = {}
        self._zoomed = False
        self._first_frame = True
        self._width, self._height = self.get_width_height()
        self.flip = Affine2D().scale(1, -1).translate(0, self._height)

        # Start WebSocket server
        try:
            self._server = websocket.WebSocketApp(
                "ws://" + HOST + ":" + PORT + "/client/" + SESSION_ID,
                on_open=self.web_socket_open,
                on_message=self.web_socket_message,
                on_close=self.web_socket_close,
                on_error=self.web_socket_close,
            )
            self._thread = thread.start_new_thread(self._server.run_forever, ())
        except Exception, e:
            print "Failed to create websocket server. (%s)" % str(e)
            # sys.exit(1)
            raise e
开发者ID:brefsdal,项目名称:peerplot,代码行数:33,代码来源:backend_h5canvas.py

示例7: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
 def __init__(self, figure):
     FigureCanvasBase.__init__(self, figure)
     if self.__class__ == matplotlib.backends.backend_gdk.FigureCanvasGDK:
         warn_deprecated('2.0', message="The GDK backend is "
                         "deprecated. It is untested, known to be "
                         "broken and will be removed in Matplotlib 2.2. "
                         "Use the Agg backend instead. "
                         "See Matplotlib usage FAQ for"
                         " more info on backends.",
                         alternative="Agg")
     self._renderer_init()
开发者ID:4over7,项目名称:matplotlib,代码行数:13,代码来源:backend_gdk.py

示例8: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
    def __init__( self, figure ):
        if DEBUG: print 'FigureCanvasQt: ', figure
        _create_qApp()

        QtGui.QWidget.__init__( self )
        FigureCanvasBase.__init__( self, figure )
        self.figure = figure
        self.setMouseTracking( True )
        # hide until we can test and fix
        #self.startTimer(backend_IdleEvent.milliseconds)
        w,h = self.get_width_height()
        self.resize( w, h )
开发者ID:Einstein-NTE,项目名称:einstein,代码行数:14,代码来源:backend_qt4.py

示例9: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
    def __init__(self, figure):
        if DEBUG:
            print('FigureCanvasQt qt4: ', figure)
        _create_qApp()

        # Note different super-calling style to backend_qt5
        QtWidgets.QWidget.__init__(self)
        FigureCanvasBase.__init__(self, figure)
        self.figure = figure
        self.setMouseTracking(True)
        self._idle = True
        w, h = self.get_width_height()
        self.resize(w, h)
开发者ID:ethanhelfman,项目名称:InstaGet,代码行数:15,代码来源:backend_qt4.py

示例10: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
    def __init__( self, figure ):
        if DEBUG: print 'FigureCanvasQt: ', figure

        QtGui.QWidget.__init__( self )
        FigureCanvasBase.__init__( self, figure )
        self.figure = figure
        self.setMouseTracking( True )
        self._idle = True
        # hide until we can test and fix
        #self.startTimer(backend_IdleEvent.milliseconds)
        w,h = self.get_width_height()
        self.resize( w, h )

        QtCore.QObject.connect(self, QtCore.SIGNAL('destroyed()'),
            self.close_event)
开发者ID:BoldingBruggeman,项目名称:gotm,代码行数:17,代码来源:mpl_backend_qt4.py

示例11: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
    def __init__(self, figure):
        if DEBUG:
            print('FigureCanvasQt: ', figure)
        _create_qApp()

        if QT5:
            # PyQt5 wants figure= ... why? :)
            QtGui.QWidget.__init__(self, figure=figure)
        else:
            QtGui.QWidget.__init__(self)
        FigureCanvasBase.__init__(self, figure)
        self.figure = figure
        self.setMouseTracking(True)
        self._idle = True
        # hide until we can test and fix
        #self.startTimer(backend_IdleEvent.milliseconds)
        w, h = self.get_width_height()
        self.resize(w, h)
开发者ID:userzimmermann,项目名称:matplotlib,代码行数:20,代码来源:backend_qt4.py

示例12: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
    def __init__(self, figure):
        if self.__class__ == matplotlib.backends.backend_gtk.FigureCanvasGTK:
            warn_deprecated(
                "2.0",
                message="The GTK backend is "
                "deprecated. It is untested, known to be "
                "broken and will be removed in Matplotlib 2.2. "
                "Use the GTKAgg backend instead. "
                "See Matplotlib usage FAQ for"
                " more info on backends.",
                alternative="GTKAgg",
            )
        if _debug:
            print("FigureCanvasGTK.%s" % fn_name())
        FigureCanvasBase.__init__(self, figure)
        gtk.DrawingArea.__init__(self)

        self._idle_draw_id = 0
        self._need_redraw = True
        self._pixmap_width = -1
        self._pixmap_height = -1
        self._lastCursor = None

        self.connect("scroll_event", self.scroll_event)
        self.connect("button_press_event", self.button_press_event)
        self.connect("button_release_event", self.button_release_event)
        self.connect("configure_event", self.configure_event)
        self.connect("expose_event", self.expose_event)
        self.connect("key_press_event", self.key_press_event)
        self.connect("key_release_event", self.key_release_event)
        self.connect("motion_notify_event", self.motion_notify_event)
        self.connect("leave_notify_event", self.leave_notify_event)
        self.connect("enter_notify_event", self.enter_notify_event)

        self.set_events(self.__class__.event_mask)

        self.set_double_buffered(False)
        self.set_flags(gtk.CAN_FOCUS)
        self._renderer_init()

        self.last_downclick = {}
开发者ID:QuLogic,项目名称:matplotlib,代码行数:43,代码来源:backend_gtk.py

示例13: initWithFrame_figure_

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
    def initWithFrame_figure_(self, frame, fig):
        """ 
        Designated initializer. 
        
        * Parameters * 
            frame : NSRect 
            fig : matplotlib.figure.Figure 
        """

        self = super(FigureCanvasView, self).initWithFrame_(frame)
        if self != None:
            FigureCanvasBase.__init__(self, fig)
            self.renderer = RendererCocoa(self)
            self.manager = None

            # several methods can change the frame,
            # so we'll just observe the common notification
            nc = NSNotificationCenter.defaultCenter()
            nc.addObserver_selector_name_object_(self, "frameChanged:", NSViewFrameDidChangeNotification, self)

            self.updateFigureSize()

        return self
开发者ID:zoccolan,项目名称:eyetracker,代码行数:25,代码来源:cocoa_backend.py

示例14: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
 def __init__(self, figure):
     FigureCanvasBase.__init__(self, figure)
     width, height = self.get_width_height()
     self.renderer = RendererMac(figure.dpi, width, height)
     _macosx.FigureCanvas.__init__(self, width, height)
开发者ID:AdamHeck,项目名称:matplotlib,代码行数:7,代码来源:backend_macosx.py

示例15: __init__

# 需要导入模块: from matplotlib.backend_bases import FigureCanvasBase [as 别名]
# 或者: from matplotlib.backend_bases.FigureCanvasBase import __init__ [as 别名]
    def __init__(self, figure):
        FigureCanvasBase.__init__(self, figure)

        self._renderer_init()
开发者ID:08s011003,项目名称:nupic,代码行数:6,代码来源:backend_gdk.py


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