Uploaded image for project: 'Zeppelin'
  1. Zeppelin
  2. ZEPPELIN-1344

Improving matplotlib integration with zeppelin

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.7.0
    • None
    • None
    • Important

    Description

      Currently plotting via matplotlib in a zeppelin notebook can be done using code like this:

      %python
      import matplotlib.pyplot as plt
      import numpy as np
      x = np.arange(5)
      y = 2*x
      plt.plot(x, y)
      z.show(plt)
      

      This style of inline notebook plotting has many limitations compared to that found in Jupyter, which of course has the advantage of being built natively in python as well as connections with the core matplotlib development team. This means for example in a Jupyter notebook, you can easily create an inline plot using

      % matplotlib inline
      import matplotlib.pyplot as plt
      import numpy as np
      x = np.arange(5)
      y = 2*x
      plt.plot(x, y)
      plt.show()
      

      You could even omit the call to plt.show() if the version of matplotlib you are using is 1.5 or later, and enable some interactive features similar to those in found in D3.js (like panning and zooming) if you instead use %matplotlib notebook at the top of the notebook cell.

      In order to accomplish this in zeppelin, we will first need to make our own custom matplotlib backend (I'll explain this in more detail in a separate JIRA issue). To summarize, these are the improvements in our matplotlib integration that should be made:

      • Create a custom matplotlib backend for plotting inline images (ZEPPELIN-1345)
      • Support interactive plotting

      On top of this, all of these changes should be ported to the pyspark interpreter as well since there are probably many users who would like to have matplotlib plotting in their spark related workflows.

      Attachments

        Issue Links

          There are no Sub-Tasks for this issue.

          Activity

            People

              agoodman Alex Goodman
              agoodman Alex Goodman
              Votes:
              4 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: