本文整理汇总了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)
示例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)