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
- depends upon
-
ZEPPELIN-1345 Create a custom matplotlib backend that natively supports inline plotting in a python interpreter cell
- Resolved
-
ZEPPELIN-1423 Allow users to specify pre/post-execute hooks for interpreters
- Resolved
-
ZEPPELIN-1361 Python interpreter - add support for AngularDisplay system
- Open
-
ZEPPELIN-1360 Printing long strings is very slow in the python interpreter
- Resolved
- supercedes
-
ZEPPELIN-2511 Matplotlib angular backend doesn't update a plot for %python interpreter
- Resolved