本文整理汇总了Python中matplotlib.backends.backend_gtk3cairo.FigureCanvasGTK3Cairo.draw_idle方法的典型用法代码示例。如果您正苦于以下问题:Python FigureCanvasGTK3Cairo.draw_idle方法的具体用法?Python FigureCanvasGTK3Cairo.draw_idle怎么用?Python FigureCanvasGTK3Cairo.draw_idle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_gtk3cairo.FigureCanvasGTK3Cairo
的用法示例。
在下文中一共展示了FigureCanvasGTK3Cairo.draw_idle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Calculator
# 需要导入模块: from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo [as 别名]
# 或者: from matplotlib.backends.backend_gtk3cairo.FigureCanvasGTK3Cairo import draw_idle [as 别名]
#.........这里部分代码省略.........
else:
y_lim.append(num2)
y_lim.append(num1)
self.x = []
self.y = []
self.x = arange(from_x,to_x,0.01)
for x in self.x:
try:
string = text.split(",")[0].replace("x",str("(%f)"%(x)))
tmp_number = solve_expresion(string)
if ( type(tmp_number) != str ):
self.y.append(tmp_number)
else:
self.y.append(None)
continue
except TypeError:
self.y.append(None)
except Exception as e:
print(e)
self.builder.get_object("plot_1").set_text("Invalid synatax, use variable x")
self.y = array(self.y)
print(len(self.x))
print(len(self.y))
self.ax.plot(self.x,self.y)
self.ax.set_xlim(from_x,to_x)
if ( len(y_lim) == 2 ):
print("ase")
self.ax.set_ylim(y_lim[0],y_lim[1])
self.ax.grid(True)
self.canvas.draw_idle()
# c == None podminka
# c = re.match("(from=[-+]?(\d{1,}) to=[-+]?(\d{1,}))|(to=[-+]?(\d{1,}) from=[-+]?(\d{1,}))"
#group(0) = founded string
#group(1) = fouund first variante
#group(2) = number from
#group(3) = number to
#group(4) = found second variante
#group(5) = number to
#group(6) = number from
def back_to_future(self,w,data=None):
if ( w.get_label() != "" ):
self.text_buff.set_text(w.get_label())
self.builder.get_object("notebook1").set_current_page(self.hisotry_page[self.history_ex.index(w.get_label())])
def add_to_history(self,expresion,page):
if ( expresion in self.history_ex):
return
if ( len(self.history_ex) == 10 ):
del(self.history_ex[0])
del(self.hisotry_page[0])
self.history_ex.append(expresion)
self.hisotry_page.append(page)
else:
self.history_ex.append(expresion)
self.hisotry_page.append(page)
示例2: __init__
# 需要导入模块: from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo [as 别名]
# 或者: from matplotlib.backends.backend_gtk3cairo.FigureCanvasGTK3Cairo import draw_idle [as 别名]
#.........这里部分代码省略.........
else:
value_str = "{0:.{1}f}".format(value, self.digits).rstrip("0")
entry.set_text(value_str)
def get_entry_value(self, entry, dtype):
text = entry.get_text()
try:
val = float(text)
if dtype == int:
val = int(val)
except ValueError:
val = None
return val
def on_button_save_clicked(self, widget):
pass
def on_cmapcombo_changed(self, widget):
tree_iter = widget.get_active_iter()
if tree_iter != None:
model = widget.get_model()
name, image = model[tree_iter]
self.cmap = name
if hasattr(self, 'fig'):
self.display_image()
self.canvas.draw_idle()
def on_namecombo_changed(self, widget):
text = widget.get_active_text()
print(text)
if text == 'Mandelbrot':
self.x = 0
self.y = 0
self.set_entry_value(self.entries['x'])
self.set_entry_value(self.entries['y'])
if hasattr(self, 'fig'):
self.update_image()
def on_button_apply_clicked(self, widget):
self.update_image()
def on_button_reset_clicked(self, widget):
for name, entry in self.entries.items():
setattr(self, name, getattr(self, name + "_default"))
self.set_entry_value(entry)
def on_canvas_button_release(self, widget, event):
mapping = {1: 0.75, 3: 1.5}
if event.button in mapping: