Often times, I ssh into another computer to do python work. While I'm coding, I like to have an ipython shell open for quick testing. For some reason, I cannot get matplotlib to open figures. Here is an example:
[mwoods@linux_box ~]$ ssh -X me@mac_machine
Password:
Last login: Fri Dec 15 13:03:37 2017
mwoods:~ /path/to/ipython
Python 3.6.3 |Anaconda, Inc.| (default, Oct 6 2017, 12:04:38)
Type ‘copyright’, ‘credit’ or ‘license’ for more information
IPython 6.1.0 — An enhanced Interactive Python. Type ‘?’ for help.
In [1]: import matplotlib as mpl
In [2]: mpl.use('Agg')
In [3]: import matplotlib.pyplot as plt
In [4]: import numpy as np
In [5]: plt.ion()
In [6]: plt.imshow(np.random.rand(8, 8))
Out[6]: <matplotlib.image.AxesImage at hex_number>
In [7]:
No plot opens. As shown, I start from a linux box and ssh into a Macintosh (I have admin privileges on the mac). The mac runs on macOS Sierra (10.12.6) and has Anaconda version 5.0.1 installed. Other X11 forwarding commands (e.g. xpdf, display) work over the same ssh connection, so I don't think it has to do with the ssh_config or sshd_config files on either machine. Could someone please help?