情节中的文字出现错误|Jupyter-R [英] Error with text in plot | Jupyter - R
问题描述
我正在尝试通过Anaconda安装在Jupyter笔记本上的R中的ggplot2在ggplot2上绘制一些数据的简单散点图.以下是我使用的代码:
I am trying to plot a simple scatterplot with some data using ggplot2 in R on Jupyter notebook installed through Anaconda. Following is the code I used:
ggplot(data = df1 [1:1000,])+ geom_point(mapping = aes(x = val1,y = val2))
结果如下:
我在使用正常绘图功能时遇到了同样的问题.对于命令-
I am experiencing the same issue with normal plot function. For the command -
df <- data.frame(x=rnorm(10000),y=rnorm(10000))
plot(df[1:1000,1],df[1:1000,])
我得到以下结果:
这是sessionInfo()
Here's the sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: Amazon Linux Bare Metal release 2012.03
Matrix products: default
BLAS: /home/dmangla/sof/anaconda3/lib/R/lib/libRblas.so
LAPACK: /home/dmangla/sof/anaconda3/lib/R/lib/libRlapack.so
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] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_0.7.4 purrr_0.2.3 readr_1.1.1 tidyr_0.7.1
[5] tibble_1.3.4 ggplot2_2.2.1 tidyverse_1.1.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.13 cellranger_1.1.0 compiler_3.4.2 plyr_1.8.4
[5] bindr_0.1 forcats_0.2.0 tools_3.4.2 digest_0.6.12
[9] uuid_0.1-2 lubridate_1.6.0 gtable_0.2.0 jsonlite_1.5
[13] evaluate_0.10.1 nlme_3.1-131 lattice_0.20-35 pkgconfig_2.0.1
[17] rlang_0.1.2 psych_1.7.8 IRdisplay_0.4.4 IRkernel_0.8.9
[21] parallel_3.4.2 haven_1.1.0 bindrcpp_0.2 xml2_1.1.1
[25] httr_1.3.1 repr_0.12.0 stringr_1.2.0 hms_0.3
[29] grid_3.4.2 glue_1.1.1 R6_2.2.2 readxl_1.0.0
[33] foreign_0.8-69 pbdZMQ_0.2-6 modelr_0.1.1 reshape2_1.4.2
[37] magrittr_1.5 scales_0.5.0 rvest_0.3.2 assertthat_0.2.0
[41] mnormt_1.5-5 colorspace_1.3-2 labeling_0.3 stringi_1.1.5
[45] lazyeval_0.2.0 munsell_0.4.3 broom_0.4.2 crayon_1.3.4
我尝试重新安装软件包,但问题仍然存在.请告诉是否有人在这里有什么问题以及如何解决.
I've tried reinstalling the packages but the problem still persists. Kindly tell if anyone knows what's the problem here and how to fix it.
感谢所有人.
推荐答案
这是Anaconda默认不安装字体的问题.解决方案是安装一些字体:
This is an issue with Anaconda not installing fonts by default. The solution is to install some fonts:
conda install -c anaconda fonts-anaconda
这篇关于情节中的文字出现错误|Jupyter-R的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!