def show_regression_scatter_plot(self):
"""Generate scatter plot with a regression line
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.lin_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")
评论列表
文章目录