title: plt.show() doesn't render the image on jupyter notebook
body: <p>When I'm trying to plot some data on jupyter notebook with pyspark environment (on python3.6) builded over EMR instance, the plot doesn't appears. Summarizing: When I run the <code>plt.show()</code> command the plot don't appear.</p>
  
  <p>First I tried putting <code>%matplotlib inline</code> at the beginning but the plot appears. Then I tried changing the backend... No luck! Only the "Agg" backend works, when I tried others the code crush.</p>
  
  <p>This is the same code I'm trying to plot:</p>
  
  <pre class="lang-py prettyprint-override"><code>import matplotlib.pyplot as plt
  plt.switch_backend('agg')
  plt.plot([1,2,3,4])
  plt.show()
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <p>Nothing...</p>
  
  <p>I also read that for plotting I need to use "%matplotlib inline" but the problem with this is that the variables defined on others cells  don't exist on <code>%matplotlib inline</code> cell.</p>
  
  <p>Let's see...</p>
  
  <p><em>Cell 1</em></p>
  
  <pre class="lang-py prettyprint-override"><code>dummy_var = 10
  </code></pre>
  
  <p><em>Cell 2</em></p>
  
  <pre class="lang-py prettyprint-override"><code>import matplotlib.pyplot as plt
  plt.plot([1,2,3,4])
  plt.show()
  print(dummy_var)
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <blockquote>
    <p>NameError: name 'dummy_var' is not defined.</p>
  </blockquote>
  
  <p><em>Disclaimer:</em>
  Being fair, the <code>%matplotlib inline</code> command works fine but I also need the outside variables, for plotting them.</p>
  
  <p><em>Cell 3</em></p>
  
  <pre class="lang-py prettyprint-override"><code>%matplotlib inline
  import matplotlib.pyplot as plt
  plt.plot([1,2,3,4])
  plt.show()
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <p>[The plot]</p>
  
  <p>This is my notebook, with the error and the examples...
  <img src="https://i.stack.imgur.com/xl3z1.png" alt="Image with the error"></p>