2

我正在尝试在 R 中使用 magick 读取 svg 图像(使用 inkscape 创建)。从这里的介绍中,imagemagick 可以读取 svg 图像。

这是我要阅读的 svg 图像。 https://www.dropbox.com/s/3dqcr7qr286m1k5/image.svg?dl=0

library(magrittr)
library(magick)
i <- "image.svg"
myimage <- image_read(i)
myimage

我可以成功读取图像,但是当我在 Rstudio 查看器中查看图像时,图像有一些失真,尤其是在标签中。 在此处输入图像描述

有没有办法避免 svg 图像出现这种失真?

我的Sys.info

       sysname        release 
     "Windows"       "10 x64" 
       version       nodename 
 "build 19041"  "SUMANKHANAL" 
       machine          login 
      "x86-64"        "suman" 
          user effective_user 
       "suman"        "suman"

sessionInfo

R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices
[4] utils     datasets  methods  
[7] base     

other attached packages:
[1] magick_2.5.2   magrittr_2.0.1
[3] reprex_0.3.0  

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.5      rstudioapi_0.13
 [3] knitr_1.30      whisker_0.4    
 [5] R6_2.4.1        rlang_0.4.10   
 [7] tools_4.0.3     xfun_0.20      
 [9] tinytex_0.26    clipr_0.7.0    
[11] htmltools_0.5.0 ellipsis_0.3.1 
[13] digest_0.6.27   tibble_3.0.3   
[15] lifecycle_0.2.0 crayon_1.3.4   
[17] processx_3.4.4  callr_3.5.1    
[19] vctrs_0.3.5     fs_1.5.0       
[21] ps_1.3.4        evaluate_0.14  
[23] rmarkdown_2.5   compiler_4.0.3 
[25] pillar_1.4.6    pkgconfig_2.0.3

4

0 回答 0