main.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:Dame 作者: jdhouti 项目源码 文件源码
def show_scatter_plot(self):
        """Generate scatter plot
            event - STRING - sent by self.x_column_selector or self.y_column_selector when a column is selected"""


        x_column_name = self.x_column_selected.get()
        y_column_name = self.y_column_selected.get()
        # scatter plot generated here - reference the canvas() method for the variable names to generate the plot
        if x_column_name == "" or y_column_name == "":
            print("Both columns are not filled wont generate scatter plot")
        elif x_column_name == y_column_name:
            # print("Both columns are the same cannot plot")
            self.same_columns_warning_label.grid()
            self.same_columns_warning_label_isVisible = True
        else:
             # make sure warning label isnt there
            if self.same_columns_warning_label_isVisible == True:
                self.same_columns_warning_label.grid_remove()
                self.same_columns_warning_label_isVisible = False


            self.f = Figure(figsize = (6,4), dpi = 100)
            self.a = self.f.add_subplot(111)
            self.a = self.scatter_object.generate(x_column_name, y_column_name, self.a, color = self.plot_color)
            self.canvas = FigureCanvasTkAgg(self.f, master=self)
            self.canvas.get_tk_widget().grid(column=3, row=1, rowspan=5, sticky="nesw")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号