[IPython-dev] remote X DISPLAY

Maximilian Albert maximilian.albert at gmail.com
Sat May 24 18:17:52 EDT 2014

Hi Vasco,

Now I want to use X forwarding show gtk matplotlib windows. This works
> as long as I keep the original SSH connection open. However, when I
> create a new ssh connection, the "DISPLAY" environment variable should
> change. Is there I way I can tell the %matplotlib gtk magic to pass a
> certain DISPLAY to gtk?

I think it should work if you put the following at the beginning of your

   import os
   os.environ['DISPLAY'] = ':10'

(or whatever new display number you now have). Untested right now, but I'm
pretty sure I used it a while back to solve precisely this problem.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140524/b94266f2/attachment.html>

More information about the IPython-dev mailing list