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


Python FigureCanvasGTKAgg.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg [as 别名]
# 或者: from matplotlib.backends.backend_gtkagg.FigureCanvasGTKAgg import __init__ [as 别名]
    def __init__(self,src,model,state):
        self.src = src
        self.model = model
        self.__state = state
        state.connect('selection-changed',self.update_spanner)
        state.connect('selection-removed',self.remove_spanner)
        xb = src.get_time_bounds()
        yb = src.get_data_bounds()
        figure = Figure(dpi=100)
        self.plot = figure.add_subplot(111,xbound=xb,ybound=yb,autoscale_on=False)
        self.plot.plot_date(src.get_time(True),src.get_data(True),'-')
        if state.selection is None:
            self.spanner = None
        else:
            vall,valr = state.selection
            self.spanner = self.plot.axvspan(vall,valr,alpha=0.5)
        self.ctx_spanners = dict()
        FigureCanvas.__init__(self,figure)
        self.mpl_connect('button_press_event',self.on_press)
        self.mpl_connect('button_release_event',self.on_release)
        self.mpl_connect('motion_notify_event',self.on_move)
        model.connect('annotation-added',self.notice_annotation)
        model.connect('annotation-removed',self.notice_annotation_removal)
        model.connect('annotation-changed',self.notice_annotation_change)

        for (id,color,boundl,boundr) in model.annotations():
            self.notice_annotation(model,id,color,boundl,boundr)
开发者ID:hguenther,项目名称:context-annotator,代码行数:29,代码来源:display.py

示例2: __init__

# 需要导入模块: from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg [as 别名]
# 或者: from matplotlib.backends.backend_gtkagg.FigureCanvasGTKAgg import __init__ [as 别名]
	def __init__(self,t_from,t_to):
		self.figure = Figure(figsize=(10,2), dpi=80)
		self.t_from = t_from
		self.t_to = t_to
		self.t_diff = math.fabs(t_from - t_to)

		self.axis = None
	
		FigureCanvas.__init__(self,self.figure)
开发者ID:RTS2,项目名称:rts2-gtk,代码行数:11,代码来源:plot.py

示例3: __init__

# 需要导入模块: from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg [as 别名]
# 或者: from matplotlib.backends.backend_gtkagg.FigureCanvasGTKAgg import __init__ [as 别名]
 def __init__(self):
     self._fig = Figure()
     FigureCanvas.__init__(self, self._fig)
     self._data = N.zeros((200, 320), dtype=N.uint8)
     self._dims = self._data.shape
     self._cmap = None
     self._rotate = 0
     self._hud = dict()
     self._hud_text = self._fig.text(0.99, 0.99, '',
         color='white',
         verticalalignment='top', horizontalalignment='right')
     self._overlays = dict()
     
     # Draw the image
     self._ax = self._fig.add_subplot(1, 1, 1)
     self._image = self._ax.imshow(self._data, cmap=matplotlib.cm.gray)
     self._ax.set_aspect('equal')
     self._fig.tight_layout()
     self.draw()
开发者ID:MarkusHackspacher,项目名称:Beams,代码行数:21,代码来源:CameraImage.py

示例4: __init__

# 需要导入模块: from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg [as 别名]
# 或者: from matplotlib.backends.backend_gtkagg.FigureCanvasGTKAgg import __init__ [as 别名]
 def __init__(self, data, x, y, slice_idx, cmap=P.cm.gray,
              norm=None, interpolation="bilinear", extent=None):
     self.norm = norm
     self.cmap = cmap        
     self.interpolation=interpolation
     self.slice_idx = slice_idx
     # extent should be static, so set it and leave it alone
     if not extent:
         y,x = data.shape[-2:]
         extent = [-x/2., x/2., -y/2., y/2.]
     self.extent = extent
     self.ylim = tuple(extent[2:])
     self.xlim = tuple(extent[:2])
     fig = P.Figure(figsize=P.figaspect(data), dpi=80)
     ax = fig.add_subplot(111)
     ax.yaxis.tick_right()
     ax.title.set_y(1.05) 
     FigureCanvas.__init__(self, fig)
     self.setData(data)
     self._init_crosshairs(x, y)
开发者ID:douglase,项目名称:recon-tools,代码行数:22,代码来源:spmclone.py

示例5: __init__

# 需要导入模块: from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg [as 别名]
# 或者: from matplotlib.backends.backend_gtkagg.FigureCanvasGTKAgg import __init__ [as 别名]
	def __init__(self):
		self.figure = Figure(figsize=(10,2), dpi=80)

		FigureCanvas.__init__(self)
开发者ID:RTS2,项目名称:rts2,代码行数:6,代码来源:dataplot.py


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