title: Cannot run matplotlib with Apache Zeppelin
body: <p>I am using Zeppelin and matplotlib to visualize some data. I try them but fail with the error below. Could you give me some guidance how to fix it?</p>
  
  <pre><code>%pyspark
  import matplotlib.pyplot as plt
  plt.plot([1,2,3,4])
  plt.ylabel('some numbers')
  plt.show()
  </code></pre>
  
  <p>And here is the error I've got</p>
  
  <pre><code>Traceback (most recent call last):
    File "/tmp/zeppelin_pyspark-3580576524078731606.py", line 235, in &lt;module&gt;
      eval(compiledCode)
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "/usr/lib64/python2.6/site-packages/matplotlib/pyplot.py", line 78, in &lt;module&gt;
      new_figure_manager, draw_if_interactive, show = pylab_setup()
    File "/usr/lib64/python2.6/site-packages/matplotlib/backends/__init__.py", line 25, in pylab_setup
      globals(),locals(),[backend_name])
    File "/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_gtkagg.py", line 10, in &lt;module&gt;
      from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\
    File "/usr/lib64/python2.6/site-packages/matplotlib/backends/backend_gtk.py", line 8, in &lt;module&gt;
      import gtk; gdk = gtk.gdk
    File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in &lt;module&gt;
      _init()
    File "/usr/lib64/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init
      _gtk.init_check()
  RuntimeError: could not open display
  </code></pre>
  
  <p>I also try to add these lines, but still cannot work</p>
  
  <pre><code>import matplotlib
  matplotlib.use('Agg')
  </code></pre>