Alex Goodman created ZEPPELIN-1344:
--------------------------------------
Summary: Improving matplotlib integration with zeppelin
Key: ZEPPELIN-1344
URL: https://issues.apache.org/jira/browse/ZEPPELIN-1344
Project: Zeppelin
Issue Type: Improvement
Components: Interpreters, python-interpreter
Affects Versions: 0.7.0
Reporter: Alex Goodman
Assignee: Alex Goodman
Fix For: 0.7.0
Currently plotting via matplotlib in a zeppelin notebook can be done using code
like this:
{code}
%python
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(5)
y = 2*x
plt.plot(x, y)
z.show(plt)
{code}
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
{code}
% matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(5)
y = 2*x
plt.plot(x, y)
plt.show()
{code}
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
- 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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)