def __scatter_plot_data_instances(self, data_instances, r = 2, outline_color = "red", fill_color = "red"): """Plots data instances""" x_axis, y_axis = din.data_instances_to_lists(data_instances) self.__plot_the_points(x_axis, y_axis, r, outline_color, fill_color) self.root.wm_title("scatter plot")
def plot_mst_graph(self, mst, r = 2, outline_color = "red", fill_color = "red", line_colour = "blue"): x_axis, y_axis = din.data_instances_to_lists(mst) self.__plot_the_points(x_axis, y_axis, r, outline_color, fill_color) largest_x = max(x_axis) largest_y = max(y_axis) for node in mst: if node.parent is not None: self.canvas.create_line(self.point_relative_dimensions(node.feature_vector[0], node.feature_vector[1], largest_x, largest_y), self.point_relative_dimensions(node.parent.feature_vector[0], node.parent.feature_vector[1], largest_x, largest_y), fill = line_colour) #TODO: currently just for debugging reasons self.canvas.create_text(self.point_relative_dimensions(node.feature_vector[0], node.feature_vector[1]-2, largest_x, largest_y), text = str(node.id), fill= "red") self.root.mainloop()
def complete_graph_plot(self, data_instances, r = 5, outline_color = "red", fill_color ="red", line_colour = "blue"): x_axis, y_axis = din.data_instances_to_lists(data_instances) self.__plot_the_points(x_axis, y_axis, r, outline_color, fill_color) self.__plot_the_lines(x_axis, y_axis, line_colour) self.root.wm_title("graph")