def plot(self): """ Show where agents are in graphical form. """ data = self.plot_data() self.scatter_plot = disp.ScatterPlot("Agent Positions", data, int(self.width), int(self.height), anim=True, data_func=self.plot_data) self.scatter_plot.show()
def plot(self): """ Show where agents are in graphical form. """ plot_type = self.props.get("plot_type", "SC") if plot_type == "LN": return super().plot() elif plot_type == "SC": data = self.plot_data() self.scatter_plot = disp.ScatterPlot(self.plot_title, data, int(self.width), int(self.height), anim=True, data_func=self.plot_data, is_headless=self.headless()) self.image_bytes = self.scatter_plot.show() return self.image_bytes
def scatter_graph(self): """ Show agent locations. """ if self.has_disp(): try: data = self.plot_data() scatter_plot = disp.ScatterPlot( self.plot_title, data, int(self.width), int(self.height), anim=True, data_func=self.plot_data, is_headless=self.headless()) scatter_plot.show() return scatter_plot except Exception as e: self.user.tell("Error when drawing graph: " + str(e)) else: return None
def scatter_graph(self): """ Show agent locations. """ if self.has_disp(): try: data = self.plot_data() scatter_plot = disp.ScatterPlot(self.plot_title, data, int(self.width), int(self.height), anim=True, data_func=self.plot_data, is_headless=self.headless(), attrs=self.attrs) scatter_plot.show() return scatter_plot except ValueError as e: # Exception as e: self.user.tell("Error when drawing scatter plot: " + str(e)) traceback.print_stack() else: return None