You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by "Panchappanavar, Naveenakumar Gurushantap (Nokia - IN/Bangalore)" <na...@nokia.com> on 2018/05/01 04:38:53 UTC

RE: pspark interpreter not working for matplot library

Hi Zhang,

Last commit id for the zeppelin repo is

 685eb9249d1c1d821ce57f1ed0559f1539dfbe69

Regards
Naveen


-----Original Message-----
From: Jeff Zhang [mailto:zjffdu@gmail.com] 
Sent: Monday, April 30, 2018 3:23 PM
To: dev@zeppelin.apache.org
Subject: Re: pspark interpreter not working for matplot library

Which commit are you in ? I suspect you may mix with different zeppelin versions.


Panchappanavar, Naveenakumar Gurushantap (Nokia - IN/Bangalore) <
naveenakumar_gurushantap.panchappanavar@nokia.com>于2018年4月30日周一 下午5:48写道:

> Hi Zhang,
>
> When I use the following code for matplot lib
>
> %pyspark
> import matplotlib.pyplot as plt
> plt.close() # Added here to reset the plot when rerunning the 
> paragraph z.configure_mpl(angular=True, close=False) plt.plot([1, 2, 
> 3], label=r'$y=x$')
>
>
> its giving the following error.
>
> Fail to execute line 3: z.configure_mpl(angular=True, close=False) 
> Traceback (most recent call last):
>   File "/tmp/zeppelin_pyspark-2003011753933267610.py", line 226, in 
> <module>
>     exec(code, _zcUserQueryNameSpace)
>   File "<stdin>", line 3, in <module>
>   File "/tmp/zeppelin_context.py", line 194, in configure_mpl
>     import mpl_config
> ImportError: No module named mpl_config
>
> Regards
> Naveen
>
>
> -----Original Message-----
> From: Jeff Zhang [mailto:zjffdu@gmail.com]
> Sent: Monday, April 30, 2018 1:46 PM
> To: dev@zeppelin.apache.org
> Subject: Re: pspark interpreter not working for matplot library
>
> 2 Approaches for you.
>
> 1. Use the ipython approach I mentioned above 2. Disable ipython by 
> setting zeppelin.pyspark.useIPython to false
>
>
>
> Panchappanavar, Naveenakumar Gurushantap (Nokia - IN/Bangalore) <
> naveenakumar_gurushantap.panchappanavar@nokia.com>于2018年4月30日周一 
> 下午4:09写道:
>
> > Hi Zhang
> >
> > In the link what you have given there they are not using pyspark 
> > only they are using python interpreter
> >
> > We are facing the problem when we are using pyspark interpreter.
> >
> > Regards
> > Naveen
> >
> >
> >
> > -----Original Message-----
> > From: Jeff Zhang [mailto:zjffdu@gmail.com]
> > Sent: Monday, April 30, 2018 1:18 PM
> > To: dev@zeppelin.apache.org
> > Subject: Re: pspark interpreter not working for matplot library
> >
> > Here's one sample notebook for your reference
> >
> >
> > https://www.zepl.com/viewer/notebooks/bm90ZTovL3pqZmZkdS9lN2Q3ODNiOD
> > Rk
> > NjA0ZjVjODM1OWZlMWExZjM4OTk3Zi9ub3RlLmpzb24
> >
> >
> > Panchappanavar, Naveenakumar Gurushantap (Nokia - IN/Bangalore) <
> > naveenakumar_gurushantap.panchappanavar@nokia.com>于2018年4月30日周一
> > 下午3:43写道:
> >
> > > Do we have any sample notebook where the following code is being used.
> > >
> > > %matplotlib inline
> > >
> > > Just to understand how it is being used,  and one more thing like 
> > > we are not using any ipython , we are using plan python2.X
> > >
> > > And one thing what we saw is when we use z.show(plt) instruction 
> > > its able to show the graph but if we use this instruction more 
> > > than once it is mixing the previous plots as well.
> > > The sample code is
> > >
> > > %pyspark
> > > import matplotlib.pyplot as plt
> > > plt.plot([1, 6, 3])
> > > plt.figure()
> > > z.show(plt)
> > > x = [0, 2, 4, 6, 8]
> > > y = [0, 3, 3, 7, 0]
> > > plt.plot(x, y)
> > > z.show(plt)
> > > plt.savefig('MyFirstPlot.png')
> > >
> > > Is there any solution for this.
> > >
> > >
> > > -----Original Message-----
> > > From: Jeff Zhang [mailto:zjffdu@gmail.com]
> > > Sent: Monday, April 30, 2018 12:47 PM
> > > To: dev@zeppelin.apache.org
> > > Subject: Re: pspark interpreter not working for matplot library
> > >
> > > Zeppelin has unit test for that guaranteed it could use matplotlib 
> > > in both pyspark & python interpreter.
> > >
> > > The only change starting from 0.8 is that zeppelin would use 
> > > ipython for python interpreter and pyspark interpreter if it is available.
> > > In that case, you can use mtpplotlib the same way in zeppelin as 
> > > it is in
> > jupyter.
> > > That means you can do inline plotting by adding the following code
> > >
> > > %matplotlib inline
> > >
> > >
> > > Panchappanavar, Naveenakumar Gurushantap (Nokia - IN/Bangalore) <
> > > naveenakumar_gurushantap.panchappanavar@nokia.com>于2018年4月30日周一
> > > 下午12:35写道:
> > >
> > > > The zeppelin version is 0.9.0 Snapshot
> > > >
> > > > Regards
> > > > Naveen
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Jeff Zhang [mailto:zjffdu@gmail.com]
> > > > Sent: Sunday, April 29, 2018 8:00 AM
> > > > To: dev@zeppelin.apache.org
> > > > Subject: Re: pspark interpreter not working for matplot library
> > > >
> > > > Which version of zeppelin do you use ?
> > > >
> > > >
> > > > Panchappanavar, Naveenakumar Gurushantap (Nokia - IN/Bangalore) 
> > > > <
> > > > naveenakumar_gurushantap.panchappanavar@nokia.com>于2018年4月29日周日
> > > > 上午4:20写道:
> > > >
> > > > > Hi All,
> > > > >
> > > > > I am trying to run pyspark interpreter by using matplot 
> > > > > library which plots simple graph,but its not showing any graph 
> > > > > plot diagram instead it returning one general object, but when 
> > > > > we use python interpreter it is able to plot the graph.
> > > > >
> > > > > Pyspark programme
> > > > > %pyspark
> > > > > import matplotlib.pyplot as plt plt.plot([1, 6, 3])
> > > > > plt.figure()
> > > > > x = [0, 2, 4, 6, 8]
> > > > > y = [0, 3, 3, 7, 0]
> > > > > plt.plot(x, y)
> > > > >
> > > > > output: [<matplotlib.lines.Line2D object at 0x496ff50>]
> > > > >
> > > > > python interpreter
> > > > > %python
> > > > > import matplotlib.pyplot as plt plt.plot([1, 6, 3])
> > > > > plt.figure()
> > > > > x = [0, 2, 4, 6, 8]
> > > > > y = [0, 3, 3, 7, 0]
> > > > > plt.plot(x, y)
> > > > > output:
> > > > > it able to plot the programme
> > > > >
> > > > > can any one please help on this.
> > > > >
> > > > > Regards
> > > > > Naveen
> > > > >
> > > > >
> > > >
> > >
> >
>