title: X11 forwarding with PyCharm and Docker Interpreter
body: <p>I am developing a project in PyCharm using a Docker interpreter, but I am running into issues when doing most "interactive" things. e.g.,</p>
  
  <pre><code>import matplotlib.pyplot as plt
  plt.plot([1, 2, 3], [4, 5, 6])
  </code></pre>
  
  <p>gives</p>
  
  <pre><code>RuntimeError: Invalid DISPLAY variable
  </code></pre>
  
  <p>I can circumvent this using</p>
  
  <pre><code>import matplotlib
  matplotlib.use('agg')
  </code></pre>
  
  <p>which gets rid of the error, but no plot is produced when I do plt.show(). I also get the same error as in the thread <a href="https://stackoverflow.com/questions/29838161/pycharm-remote-python-console-cannot-connect-to-x-server-error-with-import">[pycharm remote python console]: &quot;cannot connect to X server&quot; error with import pandas</a> when trying to debug after importing Pandas, but I cannot SSH into my docker container, so the solution proposed there doesn't work. I have seen the solution of passing "-e DISPLAY=$DISPLAY" into the "docker run" command, but I don't believe PyCharm has any functionality for specifying command-line parameters like this with a Docker interpreter. Is there any way to set up some kind of permanent, generic X11 forwarding (if that is indeed the root cause) so that the plots will be appropriately passed to the DISPLAY on my local machine? More generally, has anyone used matplotlib with a Docker interpreter in PyCharm successfully?</p>