Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【第五章 系统】grid 包的旋转功能在 RStudio 和 RGUI 窗口内的显示效果不一样 #7

Closed
XiangyunHuang opened this issue Aug 16, 2019 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@XiangyunHuang
Copy link
Owner

XiangyunHuang commented Aug 16, 2019

举例如下,

library(grid)
pushViewport(viewport(h = 0.8, w = 0.8, angle = 15))
grid.multipanel(newpage = FALSE)
popViewport()

rgui

rstudio

运行环境

在 RStudio 内运行

xfun::session_info()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8.1 x64 (build 9600), RStudio 1.2.1335

Locale:
  LC_COLLATE=Chinese (Simplified)_China.936 
  LC_CTYPE=Chinese (Simplified)_China.936   
  LC_MONETARY=Chinese (Simplified)_China.936
  LC_NUMERIC=C                              
  LC_TIME=Chinese (Simplified)_China.936    

Package version:
  base64enc_0.1.3 bookdown_0.12   compiler_3.6.1  digest_0.6.20  
  evaluate_0.14   glue_1.3.1      graphics_3.6.1  grDevices_3.6.1
  highr_0.8       htmltools_0.3.6 jsonlite_1.6    knitr_1.24     
  magrittr_1.5    markdown_1.1    methods_3.6.1   mime_0.7       
  packrat_0.5.0   Rcpp_1.0.2      rmarkdown_1.14  stats_3.6.1    
  stringi_1.4.3   stringr_1.4.0   tinytex_0.15    tools_3.6.1    
  utils_3.6.1     xfun_0.8        yaml_2.2.0  

在 R Gui 中运行

R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8.1 x64 (build 9600)

Locale:
  LC_COLLATE=Chinese (Simplified)_China.936 
  LC_CTYPE=Chinese (Simplified)_China.936   
  LC_MONETARY=Chinese (Simplified)_China.936
  LC_NUMERIC=C                              
  LC_TIME=Chinese (Simplified)_China.936    

Package version:
  compiler_3.6.1  graphics_3.6.1  grDevices_3.6.1 stats_3.6.1    
  tools_3.6.1     utils_3.6.1     xfun_0.8     

奇怪的是

Travis 上编译出来的效果和 RStudio 内一样,不知问题出在哪? @yihui

在线编译的效果见 https://msg-book.netlify.com/system.html#section-25

@yihui
Copy link
Collaborator

yihui commented Aug 16, 2019

我不知道啊。

另外,你给的这个 netlify 链接打不开。

@XiangyunHuang
Copy link
Owner Author

XiangyunHuang commented Aug 16, 2019

是刚才引入一个新的 R 包 GGally 去替代 ggplot2 的 ggpcp 函数,GGally 还没添加到镜像里(需要一点时间), 所以暂时 Travis 编译不了书籍,网址暂时挂了。

之前更新的网址见 https://bookdown.org/xiangyun/msg/

@XiangyunHuang XiangyunHuang added the bug Something isn't working label Aug 18, 2019
@XiangyunHuang XiangyunHuang changed the title grid 包的旋转功能在 RStudio 和 RGUI 窗口内的显示效果不一样 【第五章 系统】grid 包的旋转功能在 RStudio 和 RGUI 窗口内的显示效果不一样 Aug 19, 2019
@XiangyunHuang
Copy link
Owner Author

旋转的特点表达了就行,先把这个关掉了

@XiangyunHuang
Copy link
Owner Author

使用图形设备保存图片,出来的效果和在 RStudio View 里看到的一样

svglite::svglite(file = "rotate.svg")
png(file="rotate.png")
library(grid)
pushViewport(viewport(h = 0.8, w = 0.8, angle = 15))
grid.multipanel(newpage = FALSE)
popViewport()
dev.off()

@XiangyunHuang
Copy link
Owner Author

首先应该打开一个绘图窗口,添加一行 grid.newpage() 即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants