-1

I have imported plotnine and run the following code.

The examples run, but when I run a plot like the one below I get all the x and y values printed in the margin. Anyone else r

x       = np.arange(-5.,5.,0.25,dtype=float)
gamma   = 5.
y       = gamma * x / (x ** 2 + gamma)
gg      = pd.DataFrame()
gg['x'] = x
gg['y'] = y

p = ggplot(aes(x,y),gg) + geom_point() 
p.save(filename = 'test3.png', height=5, width=5, units = 'cm')
p

jupyter lab plot output

bill fite
  • 43
  • 5

1 Answers1

0

In the words of Roseanne Rosannadanna -- 'Nevermind'.

Unless someone else is converting from the R ggplot package.

I've probably written about a 1000 ggplots in R and the problem above is that the R ggplot statement takes an x and y variables as above:

p = ggplot(aes(x,y),gg) + geom_point() 

Apparently the plotnine needs to have x and y assigned, so this works:

p = ggplot(aes(x='x',y='y'),gg) + geom_point().
bill fite
  • 43
  • 5