RuntimeError: Invalid DISPLAY variable

Remote server plotting error

This error is because the remote server does not have a graphical interface. So we need to add to the code:

import matplotlib.pyplot as plt
plt.switch_backend('agg')
i.e., use a Backend that doesn't require a GUI, so that's fine

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325937549&siteId=291194637