Summary: How do I plot figures, over SSH, to a remote computer when the local computer is running OS X?
I have computer A and I am trying to use matplotlib to plot on computer B. The problem I am having is that when I use matplotlib the plots only display on Computer A. I VNC in and watch them pop up. I can ssh -X/-Y into Computer A and run xcalc and it will display on computer B. I can connect Computer B to a third computer, running Red Hat, and plots will display on Computer B. I am convinced it is not Computer B that is the problem. I believe my problem is the same as this problem: none of the package installers support X11 backends for matplotlib. I cannot comment so I'm stuck putting what I've tried in a new question. This is another description of the same problem with multiple solution attempts that do not work.
As mentioned, I have tried a lot of solutions in terms of installing backends for matplotlib on Computer A. I've tried all manor of macports and homebrew and pip combinations. I'm pretty sure it is a bad idea to mix so many package handlers, but so many solutions seem to be "sudo ***** install package-name".
To test whether matplotlib is doing what I want I use the following python snippet:
import matplotlib
matplotlib.use('gtk') # gtk is an example, I change it
import matplotlib.pyplot as plt
plt.ion()
plt.figure(1)
plt.plot([1]*10)
I can't recall all the things I have tried. Some things I have tried:
I tried using GTK and GTKCairo, which did not solve my problem because I cannot get GTK to work. Homebrew GTK does not support X11 anymore anyway, so even if it did install properly I don't think it will solve my problem. I have not yet tried to install GTK some other way. Would I have to install it from source? Has anyone got this working?
The GTK error:
ImportError: No module named _backend_gdk
Backends MacOS, TkAgg, qt5agg all work but figures display on Computer A. I had to install pyqt5. If I am not connected via VNC, then python will thrown an error about no displays. All three give the same error:
Feb 22 13:00:22 Python[57649] <Error>: Set a breakpoint at CGSLogError to catch errors as they are logged.
Feb 22 13:00:22 Python[57649] <Error>: This user is not allowed access to the window system right now.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
This does not solve my problem. This doesn't either.
Details:
Computer A runs OS X 10.11 Computer B runs OS X 10.12
Edit: I installed PyQt4 from source (along with QT) and it didn't help. I explicitly downloaded and installed the X11 version. I set matplotlib.use('qt4agg') and figures still appear on Computer A. Perhaps it was my install of QT for "macosx"? I dunno