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:[email protected]]
Sent: Monday, April 30, 2018 12:47 PM
To: [email protected]
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) <
[email protected]>于2018年4月30日周一 下午12:35写道:
> The zeppelin version is 0.9.0 Snapshot
>
> Regards
> Naveen
>
>
> -----Original Message-----
> From: Jeff Zhang [mailto:[email protected]]
> Sent: Sunday, April 29, 2018 8:00 AM
> To: [email protected]
> Subject: Re: pspark interpreter not working for matplot library
>
> Which version of zeppelin do you use ?
>
>
> Panchappanavar, Naveenakumar Gurushantap (Nokia - IN/Bangalore) <
> [email protected]>于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
> >
> >
>