首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GGally::ggpairs绘图不显示相关系数

GGally::ggpairs绘图不显示相关系数
EN

Stack Overflow用户
提问于 2020-06-11 04:23:36
回答 1查看 873关注 0票数 4

我正在尝试理解为什么在传递命令ggpairs(iris, mapping=ggplot2::aes(colour = Species))时没有显示具有相关系数的图

console output

它看起来是这样的:the plots displaying the correlation coefficient are not visible

如果我在绘图上执行inspect元素,html中的image标签是:

代码语言:javascript
复制
<img id="img" width="100%" height="100%" style="display: inline;" src="http://127.0.0.1:27032/graphics/b7091da9-1a0a-4672-902e-7c844add4aa9.png">

我刚刚开始学习R,因此这让我感到困惑。我觉得这是一个语言环境的问题,所以我试着通过

Sys.setlocale("LC_ALL", 'en_US.UTF-8')

尽管再次调用库,但没有发生任何变化。

以下是一些详细信息:

R version 4.0.1 (2020-06-06) running on Arch Linux x86_64 5.6.15-arch1-1

代码语言:javascript
复制
> Sys.getlocale()
[1] "LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=C;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C"

如果我没有提供足够的数据,我道歉。如果是这样的话,我会更新这个。

使用install.packages("GGally", type = 'source')的输出更新post

代码语言:javascript
复制
> install.packages("GGally", type = 'source')
Installing package into ‘/home/mogad0n/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/GGally_2.0.0.tar.gz'
Content type 'application/x-gzip' length 1393325 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

* installing *source* package ‘GGally’ ...
** package ‘GGally’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (GGally)

The downloaded source packages are in
    ‘/tmp/RtmpvIM27v/downloaded_packages’
EN

回答 1

Stack Overflow用户

发布于 2020-09-24 02:25:35

这显然与在linux中渲染等宽字体时的冲突有关--冲突似乎与tex有关(参见herehere)。

这是它之前的样子:

代码语言:javascript
复制
library(GGally)
iris %>% 
  select(Sepal.Length:Petal.Width) %>% 
  ggpairs()

输出:

在我告诉它使用sans字体之后:

代码语言:javascript
复制
iris %>% 
  select(Sepal.Length:Petal.Width) %>% 
  ggpairs(upper = list(continuous = wrap("cor", family="sans")))

输出:

适用于我的Ubuntu 20.04和R版本4.0.2

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62312493

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档