I am working with a slow ssh-connection to a server. I want to save a figure like
#1
import matplotlib.pyplot as plt
plt.plot([1,2,4])
plt.plot([1,3,4])
#...
plt.savefig("foo.jpg")
and show it with
feh foo.png
because feh is fast. Note there is no plt.show()
But the code #1 is still very slow as long as I'm running ssh -X, because every plot()-instance connects to the display. If -X is left out it's fast, but then another connection is needed for the feh...
What is the reason for plot() connecting to the display and can it be avoided?