Displaying ggplot2 graphs from R in Jupyter

前提是你 提交于 2019-11-30 09:36:54

You can show the graphs inline with this option.

options(jupyter.plot_mimetypes = 'image/png')

You can also produce pdf files as you would regularly in R, e.g.

pdf("test.pdf")
ggplot(data.frame(a=rnorm(100,1,10)),aes(a))+geom_histogram()
dev.off()

There are currently some issues with producing ggplot2 outputs using the IRkermel. There is an open issue on GitHub about it. The only workaround at the moment appears to be using PDF, jpg, png outputs for your plots.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!