tkinter.TclError: couldn’t connect to display “localhost:18.0”

The problem is that you are using an interactive backend which is trying to create figure windows for you, which are failing because you have disconnected the x-server that was available when you started the simulations.

Change your imports to

import matplotlib
matplotlib.use('pdf')
import matplotlib.pyplot as plt

Leave a Comment

404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.