I have a piece of code in python that creates an animation, and generates a plot. The code relevant to the animation is as below:
class Node:
def __init__(self):
self.fig, self.ax = plt.subplots()
self.ln_agents, = plt.plot([],[], 'bs')
ani = animation.FuncAnimation(self.fig, self.draw_agents, self.new_data, init_func=self.init_2DSpace, interval=200)#interval=2000
plt.show()
def draw_agents(self, points):
if condition met:
plt.close()
self.ln_agents.set_xdata(np.array(points[0]))
self.ln_agents.set_ydata(np.array(points[1]))
The animation should stop when some condition is met. I need to run this code on a remote server, such that it continues running even when the ssh connection is dropped. I know I can achieve this with the screen command on the ubuntu terminal. I don't need to see the output on my local machine. When I ssh to the server without the -X flag I get the following error
Unexpected error: (, TclError('no display name and no $DISPLAY environment variable',), )
Any suggestions? Thanks!!