Hi Abhi,

You'll need to define show(). Such as

%pyspark
import StringIO
def show(p):
  img = StringIO.StringIO()
  p.savefig(img, format='svg')
  img.seek(0)
  print "%html " + img.buf


Hope this helps.

Best,
moon

On Wed, Feb 10, 2016 at 4:34 AM Abhi Basu <9000r...@gmail.com> wrote:

> Using Zeppelin 0.5.6
>
> %pyspark
> import matplotlib.pyplot as plt
>
> # Test data
> x = [1, 2, 3, 4, 5, 6, 7, 8]
> y = [20, 21, 20.5, 20.81, 21.0, 21.48, 22.0, 21.89]
>
> # Plot
> plt.plot(x, y, linestyle='dashed', marker='o', color='red')
> show(plt)
>
>
>
> Traceback (most recent call last): File "/tmp/zeppelin_pyspark.py", line
> 225, in <module> eval(compiledCode) File "<string>", line 5, in <module>
> NameError: name 'show' is not defined
>
>
> The code executes fine, but the show command gives the error. How to fix
> this?
>
> Thanks,
>
> Abhi
>
> --
> Abhi Basu
>

Reply via email to