我正按照https://www.datacamp.com/community/blog/jupyter-notebook-r中的说明,使用R magic在jupyter笔记本中绘图。但是,用
%%R -w 800 -h 480 -u px
plot(mtcars)
my plot shows blank boxes wherever text should be。没有打印警告或错误。此外,当我将图打印到pdf而打开pdf时,情节看起来很正常:
%%R -w 800 -h 480 -u px
pdf("file.pdf",width=6,height=4,paper='special')
plot(mtcars)
dev.off()
可能会发生什么?
sessionInfo()
的输出:
R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.9 (Final)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] tools stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] ggplot2_2.2.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.13 digest_0.6.12 grid_3.3.2 plyr_1.8.4
[5] gtable_0.2.0 magrittr_1.5 scales_0.5.0 rlang_0.1.2
[9] stringi_1.1.5 reshape2_1.4.2 lazyeval_0.2.0 labeling_0.3
[13] stringr_1.2.0 munsell_0.4.3 colorspace_1.3-2 tibble_1.3.4