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


Python FigureCanvasTkAgg.set_window_title方法代码示例

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


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

示例1: Preview

# 需要导入模块: from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg [as 别名]
# 或者: from matplotlib.backends.backend_tkagg.FigureCanvasTkAgg import set_window_title [as 别名]
class Preview(tk.Frame):
    #def __init__(self, parent, dim, dpi=36, label=None):
    def __init__(self, parent, dim, dpi=36, label=None, col=0, row=0):
        tk.Frame.__init__(self, parent)
        self.dim = dim
        self.bg = np.zeros((int(dim), int(dim)), float)
        ddim = dim/dpi
        self.figure = Figure(figsize=(ddim, ddim), dpi=dpi, frameon=False)
        self.canvas = FigureCanvasTkAgg(self.figure, master=self)
        self.canvas.get_tk_widget().grid(column=0, row=0)#, sticky=(N, W, E, S))
        if label:
            tk.Label(self, text=label).grid(column=0, row=1)
        self._createAxes()
        
    def setWindowTitle(self,title):
        """ Set window title"""
        self.canvas.set_window_title(title)

    def _createAxes(self):
        """ Should be implemented in subclasses. """
        pass
    
    def _update(self):
        """ Should be implemented in subclasses. """
        pass
    
    def clear(self):
        self._update(self.bg)
        
    def updateData(self, Z):
        self.clear()
        self._update(Z)
开发者ID:I2PC,项目名称:scipion,代码行数:34,代码来源:matplotlib_image.py

示例2: arange

# 需要导入模块: from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg [as 别名]
# 或者: from matplotlib.backends.backend_tkagg.FigureCanvasTkAgg import set_window_title [as 别名]
# plt.title('Databricks Visualization')


t = arange(0.0, 3.0, 0.01)
s = sin(2*pi*t)

# ax.plot(t, s)



canvas = FigureCanvasTkAgg(fig, master=root)
canvas.show()
canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)

canvas.set_window_title('AMON')
canvas.mpl_connect('button_press_event', onClick)
canvas.show()
# using evaluate built-in function-- taken in an expression and evaluates it!

def evaluate(event):
    data = e.get()
    print data


e = Entry(root)
e.bind("<Return>", evaluate)
e.pack()

while True:
    im = ax.imshow(np.random.random([128,128]), origin = 'upper', cmap=plt.cm.RdYlGn, interpolation = 'nearest', vmax = 0, vmin = -400000)
开发者ID:abhishekrb19,项目名称:Tkinter-Tutorial,代码行数:32,代码来源:01_calc_app.py


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