Zeppelin v0.10 not showing matplotlib graphs

I upgraded to Apache Zeppelin v0.10.x from v0.9.x and randomly my Python Matplotlib scripts stopped rendering images. Anything that called the plot method would just return the string response of the function. Like below:

1
2
3
4
5
%python
import matplotlib.pyplot as plt
plt.plot([1, 2, 3])

[<matplotlib.lines.Line2D at 0x7ff547624210>]

If this happens to you, just add the following directive after %python:

1
2
3
4
5
%python
%matplotlib inline

import matplotlib.pyplot as plt
plt.plot([1, 2, 3])

After that, it should work again:

I’m not sure why this seems to happen. After it’s applied it seems to apply to all future blocks too.

Copyright - All Rights Reserved

Comments

Comments are currently unavailable while I move to this new blog platform. To give feedback, send an email to adam [at] this website url.