本文整理汇总了Python中matplotlib.backends.backend_tkagg.FigureCanvasTkAgg.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasTkAgg.__init__方法的具体用法?Python FigureCanvasTkAgg.__init__怎么用?Python FigureCanvasTkAgg.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_tkagg.FigureCanvasTkAgg
的用法示例。
在下文中一共展示了FigureCanvasTkAgg.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg [as 别名]
# 或者: from matplotlib.backends.backend_tkagg.FigureCanvasTkAgg import __init__ [as 别名]
def __init__(self,
**kwargs):
self.master = kwargs.get('master')
self.mode = kwargs.get('mode', 'scroll')
self.kwargs = kwargs
self.lines = []
self.figure = Figure()
self.axes = self.figure.add_subplot(111)
FigureCanvasTkAgg.__init__(self, self.figure,
master=self.master)
self.tkwidget = self.get_tk_widget()
示例2: __init__
# 需要导入模块: from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg [as 别名]
# 或者: from matplotlib.backends.backend_tkagg.FigureCanvasTkAgg import __init__ [as 别名]
def __init__(self, seq=None, parent=None, width=18, height=6, dpi=100):
fig = Figure(figsize=(width, height), dpi=dpi)
fig.set_facecolor(parent['background'])
self.axes = fig.add_subplot(111)
# We want the axes cleared every time plot() is called
self.axes.hold(False)
# Store the sequence object
self.seq = seq
# Plot the chromatograph
self.compute_initial_figure()
#fig.tight_layout(rect=(0.03, 0, 0.98, 0.95))
FigureCanvas.__init__(self, fig, master=parent)
示例3: __init__
# 需要导入模块: from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg [as 别名]
# 或者: from matplotlib.backends.backend_tkagg.FigureCanvasTkAgg import __init__ [as 别名]
def __init__(self,figure,master):
FigureCanvasTkAgg.__init__(self,figure,master)
self.master = master
self.cWidth,self.cHeight = figure.get_figwidth()*figure.dpi,\
figure.get_figheight()*figure.dpi
self.b1 = "up"
self.b2 = "up"
self.x1old,self.y1old = None,None
self.x2old,self.y2old = None,None
self.yCenter = 203 # center of the psiGraph in pixels
self.yScale = -80. # Number of pixels from 0 to 1, takes into account reversed directions
self.psiXlist,self.psiYlist = -1*np.ones(self.cWidth),self.yCenter*np.ones(self.cWidth)
self.VXlist,self.VYlist = -1*np.ones(self.cWidth),self.yCenter*np.ones(self.cWidth)
self.oldPsi = None # stores psYlist and
self.oldV = None # VYlist for modification
self.get_tk_widget().bind("<Motion>", self.motion)
self.get_tk_widget().bind("<ButtonPress-1>", self.b1down) # left click
self.get_tk_widget().bind("<ButtonRelease-1>", self.b1up) # for psi
self.get_tk_widget().bind("<ButtonPress-3>", self.b2down) # right click
self.get_tk_widget().bind("<ButtonRelease-3>", self.b2up) # for V(x)
self.get_tk_widget().bind("<ButtonPress-2>",self.loadOldCurves) # So you can extend a curve
self.get_tk_widget().bind("<space>",lambda event: globalV.pauseUnpause())
示例4: __init__
# 需要导入模块: from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg [as 别名]
# 或者: from matplotlib.backends.backend_tkagg.FigureCanvasTkAgg import __init__ [as 别名]
def __init__(self,title,xlabel,ylabel,master=None, width=6, height=3, dpi=100):
self.fig = Figure(figsize=(width,height), dpi=dpi, facecolor='k', edgecolor = 'none')
FigureCanvasTkAgg.__init__(self,figure = self.fig,master = master)
self.fig.subplots_adjust(bottom=0.15,left=0.1, right=0.95)
self.setGraphSettings(title,xlabel,ylabel)
示例5: __init__
# 需要导入模块: from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg [as 别名]
# 或者: from matplotlib.backends.backend_tkagg.FigureCanvasTkAgg import __init__ [as 别名]
def __init__(self, figure, parent):
FigureCanvasTkAgg.__init__(self, figure, parent)
self.toolbar = NavigationToolbar2TkAgg(self, parent)
self.toolbar.update()
self.mpl_connect('key_press_event', self.on_key_event)