Try this

%pyspark



%matplotlib inline

import matplotlib.pyplot as plt



plt.figure()



plt.plot([1, 2, 3])

Manuel Sopena Ballesteros <manuel...@garvan.org.au> 于2019年10月30日周三 上午9:39写道:

> Another example:
>
>
>
> %pyspark
>
>
>
> import matplotlib.pyplot as plt
>
>
>
> plt.plot([1, 2, 3])
>
> z.show(plt)
>
> plt.close()
>
>
>
> <module 'matplotlib.pyplot' from
> '/home/mansop/anaconda2/lib/python2.7/site-packages/matplotlib/pyplot.pyc'>
>
>
>
> According to documentation
>
>
> https://zeppelin.apache.org/docs/0.8.0/interpreter/python.html#matplotlib-integration
>
>
>
> Am I right assuming that I can use z.show in %pyspark?
>
>
>
> Thank you
>
>
>
> Manuel
>
>
>
> *From:* Manuel Sopena Ballesteros [mailto:manuel...@garvan.org.au]
> *Sent:* Wednesday, October 30, 2019 12:12 PM
> *To:* users@zeppelin.apache.org
> *Subject:* can't plot
>
>
>
> Dear Zeppelin user community,
>
>
>
> I am running Zeppelin 0.8.0 and I am not able to print a plot using
> pyspark interpreter:
>
>
>
> This is my notebook:
>
>
>
> %pyspark
>
>
>
> import matplotlib.pyplot as plt
>
>
>
> plt.figure()
>
>
>
> plt.plot([1, 2, 3])
>
>
>
> And this is the output:
>
>
>
> [<matplotlib.lines.Line2D object at 0x7fd34321c450>]
>
>
>
> Any idea?
>
> NOTICE
>
> Please consider the environment before printing this email. This message
> and any attachments are intended for the addressee named and may contain
> legally privileged/confidential/copyright information. If you are not the
> intended recipient, you should not read, use, disclose, copy or distribute
> this communication. If you have received this message in error please
> notify us at once by return email and then delete both messages. We accept
> no liability for the distribution of viruses or similar in electronic
> communications. This notice should not be removed.
> NOTICE
> Please consider the environment before printing this email. This message
> and any attachments are intended for the addressee named and may contain
> legally privileged/confidential/copyright information. If you are not the
> intended recipient, you should not read, use, disclose, copy or distribute
> this communication. If you have received this message in error please
> notify us at once by return email and then delete both messages. We accept
> no liability for the distribution of viruses or similar in electronic
> communications. This notice should not be removed.
>


-- 
Best Regards

Jeff Zhang

Reply via email to