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


Python FigureCanvasQTAgg.update方法代码示例

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


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

示例1: MyWindow

# 需要导入模块: from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg import update [as 别名]

#.........这里部分代码省略.........
                                self.g_points[p2].y())
                    lin.setPen(self.view.p)
                    lin.point_to = self.g_points[p]
                    lin.point_from = self.g_points[p2]
                    self.g_edges.append(lin)
                    self.view.scene.addItem(lin)
        self.save_path()
        if not self.check_connection():
            self.create_random()
        for e in self.g_edges:
            self.redacted_line = e
            self.tbl = self.redacted_line.tbl
            self.create_random_table(True)
            self.redacted_line.save_info(self.tbl)
            self.redacted_line = 0

    def add_random_edge(self):
        miss_edges = []
        for e in self.base_tree_edges:
            if e not in self.g_edges:
                miss_edges.append(e)
        r1 = random.randint(0, miss_edges.__len__() - 1)
        r2 = random.randint(0, self.g_edges.__len__() - 1)
        adding_edge = miss_edges[r1]
        del_edge = self.g_edges[r2]
        '''print(self.base_tree_edges)
        print(miss_edges)
        print(self.g_edges)
        print(miss_edges[r1], " & ", self.g_edges[r2])'''
        self.view.scene.addItem(adding_edge)
        self.g_edges.append(adding_edge)
        self.view.scene.removeItem(del_edge)
        self.g_edges.remove(del_edge)
        self.view.scene.update()
        self.save_path()
        if not self.check_connection():
            self.view.scene.addItem(del_edge)
            self.g_edges.append(del_edge)
            self.view.scene.removeItem(adding_edge)
            self.g_edges.remove(adding_edge)
            self.view.scene.update()
            self.add_random_edge()
        else:
            '''if de_num > 0:
                self.view.scene.addItem(del_edge)
                self.g_edges.append(del_edge)
                self.view.scene.removeItem(adding_edge)
                self.g_edges.remove(adding_edge)
                self.view.scene.update()
            else:
                print("\/")
                print(-de_num)
                print("||")'''
    #        print("-------------")
    #        print(self.last_time)
    #        print("\/")
            dif = -self.last_time
            noch = self.last_time
            self.last_time = (self.get_global_weight().day-1)*24*60+self.get_global_weight().hour*60+self.get_global_weight().minute
            dif += self.last_time
    #        print(dif)
            ra_a = random.uniform(0, math.e)
            ra_b = math.pow(math.e, -dif/self.t)
    #        print(math.pow(math.e, -dif/self.t))
    #        print("\/")
    #        print(self.last_time)
开发者ID:makaronnik13,项目名称:pathfinder,代码行数:70,代码来源:MyWindow.py


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