title: Matplotlib while debugging in Pycharm: How to turn off interactive mode?
body: <p>First of all, I am working on the Pycharm debug console and want to put a caption under my diagram. According to <a href="https://stackoverflow.com/a/34011963/5240546">this answer</a> this can be achieved by:</p>
  
  <pre><code>plt.plot([2,5,1,2]
  fig = plt.figure()
  fig.text(.5, .05, "text", ha="center")
  plt.show()
  </code></pre>
  
  <p>However, this shows me the plot at first, then an empty window (after typing the second line) and nothing later.</p>
  
  <p>I figured out this must be because of interactive mode of matplotlib so I turned it off using <code>plt.ioff()</code> in the debug session after which <code>plt.isinteractive()</code> returns <code>False</code>. Still this does not change its behaviour and shows the plot right after the <code>plt.plot(...)</code> command.</p>
  
  <p>Weirdly enough when I put <code>plt.ioff()</code> in my script, it is ignored and <code>plt.isinteractive()</code> returns <code>True</code>.</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  plt.ioff()
  plt.plot([1,2,3,4,5])
  print(plt.isinteractive())
  </code></pre>
  
  <p>My system information:</p>
  
  <ul>
  <li>PyCharm CE 2017.3.2</li>
  <li>macOS Sierra 10.12.6</li>
  <li>Python 3.6.3 in an Anaconda Environment</li>
  </ul>
  
  <p>Can anyone reproduce this? Is there another way to create more complicated diagrams from the Pycharm debug console? I would prefer to not change my development environment everytime I want to plot something more complicated.</p>