plotnine icon indicating copy to clipboard operation
plotnine copied to clipboard

Please provide some example with plain Python

Open CdeMills opened this issue 6 years ago • 3 comments

Hello, all the examples and tutorial are based on iPython: %matplotlib inline

start generating some fancy graph

How can I produce graphs in a simple python script ? f, ax = plt.subplots(figsize=(8, 6)

generate some graph

plt.show()

Thanks

CdeMills avatar Aug 22 '19 15:08 CdeMills

like this

from plotnine import *
from plotnine.data import mtcars
p = ggplot(mtcars, aes(x='hp', y='mpg))
p = p + geom_point()
p.save("output.png")

TyberiusPrime avatar Aug 22 '19 19:08 TyberiusPrime

OK, thanks. Is there something similar to plt.show() ?

Thank you Pascal

CdeMills avatar Aug 22 '19 21:08 CdeMills

OK, thanks. Is there something similar to plt.show() ?

print(p)

has2k1 avatar Aug 22 '19 21:08 has2k1