我在 Jupyter 中使用 R,但无法在笔记本本身中绘制图表。
这是一个可重现的示例
set.seed(123)
mat = as.matrix(x = rnorm(100), y = rnorm(100))
plot(mat)
在朱皮特中:
Error in png(tf, width, height, "in", pointsize, bg, res, antialias = antialias): unable to start png() device
Traceback:
如果我使用以下内容,我可以将图像保存在png当前工作目录中的格式。
png('test.png')
plot(mat)
dev.off()
Edit:
SessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 16299)
我已经经历了以下过程,但没有一个解决我的问题。
- 在 Jupyter 中显示 R 中的 ggplot2 图表 https://stackoverflow.com/questions/30920380/displaying-ggplot2-graphs-from-r-in-jupyter
- 无法使用 R 内核在 jupyter 笔记本中绘图 https://github.com/jupyter/docker-stacks/issues/210
- 需要 libXrender.so.1 才能内联显示 R 绘图 https://github.com/jupyter/docker-stacks/issues/54
- 无法显示png https://stackoverflow.com/questions/17243648/cant-display-png?rq=1
-
GitHub 上的 R 内核笔记本中的图形渲染 https://github.com/IRkernel/IRkernel/issues/145(与Github相关)
我有完全相同的问题。我关闭了Anaconda,再次打开它,然后更新了内核;最后,再次运行,没有任何错误。
conda install -c r r-essentials
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)