def plot_util(self): self.fig, self.graph = plt.subplots(figsize=self.window_shape) self.fig.canvas.mpl_connect('close_event', self.on_close) self.graph.yaxis.set_visible(False) self.graph.xaxis.set_visible(False) self.graph.text(0, 1.15, self.title, transform=self.graph.transAxes, size=24, weight=300, ha='left', va='top') self.bar_collections = self.graph.bar(self.x, self.arr[0], align='edge', width=0.5) # since the animate method in not returning any thing, thus we are using blit=False anim = FuncAnimation(self.fig, self.animate, frames=self.arr.shape[0], interval=self.interval, blit=0, repeat=self.repeat, repeat_delay=1000) plt.box(False) time.sleep(1) plt.show() anim.event_source.stop() del anim plt.close()