Error in grid.Call(C_stringMetric, as.graphicsAnnot(x$label))
0
0
Entering edit mode
3.4 years ago
yueli7 ▴ 250

Hello,

I tired to use ggplot.

I think there is something wrong with the font, but I have no idea.

Thank you in advance for great help!

Best,

Yue

> pep_plot <- ggplot(peptide_summary,
+        aes(x = start, xend = end, y = spectral_count, yend = spectral_count)) +
+   geom_segment(size = 1) +
+   ylim(0, 5) + 
+   xlab("peptide position within protein") +
+   ylab("peptide count")

> pep_plot
Error in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)) : 
X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 1 at size 11 could not be loaded


> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

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] shiny_1.5.0    extrafont_0.17 dplyr_0.8.2    ggplot2_3.3.2  parsemsf_0.1.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.5       later_1.1.0.1    pillar_1.4.7     compiler_3.6.1  
 [5] dbplyr_1.3.0     highr_0.8        tools_3.6.1      digest_0.6.27   
 [9] bit_4.0.4        RSQLite_2.2.1    memoise_1.1.0    lifecycle_0.2.0 
[13] tibble_3.0.4     gtable_0.3.0     pkgconfig_2.0.3  rlang_0.4.9     
[17] DBI_1.1.0        xfun_0.19        fastmap_1.0.1    Rttf2pt1_1.3.8  
[21] withr_2.3.0      stringr_1.4.0    knitr_1.30       vctrs_0.3.5     
[25] bit64_4.0.5      grid_3.6.1       tidyselect_1.1.0 glue_1.4.2      
[29] R6_2.5.0         tidyr_1.1.2      purrr_0.3.4      farver_2.0.3    
[33] extrafontdb_1.0  blob_1.2.1       magrittr_2.0.1   promises_1.1.1  
[37] htmltools_0.5.0  scales_1.1.1     ellipsis_0.3.1   assertthat_0.2.1
[41] xtable_1.8-4     mime_0.9         colorspace_2.0-0 httpuv_1.5.4    
[45] labeling_0.4.2   stringi_1.5.3    lazyeval_0.2.2   munsell_0.5.0   
[49] crayon_1.3.4
software error • 4.3k views
ADD COMMENT
1
Entering edit mode

Try using ggsave to write the plot to a file and then opening that file. This could be a problem with the graphical display device.

ADD REPLY
0
Entering edit mode

Hello _r_am,

Thank you so much for your great help!

Thank you again and really apprectiated!

Best,

Yue

I tried to use ggsave to save the plot.

> pep_plot <- ggplot(peptide_summary,
+        aes(x = start, xend = end, y = spectral_count, yend = spectral_count)) +
+   geom_segment(size = 1) +
+   ylim(0, 5) + 
+   xlab("peptide position within protein") +
+   ylab("peptide count")

 > ggplot2::ggsave(filename="protein", plot=pep_plot, device="eps",dpi=1200, width=15, height=10, units="cm")
ADD REPLY
1
Entering edit mode

I tried to use ggsave to save the plot

And what happened? Why use an eps device instead of, say, png or pdf?

ADD REPLY
0
Entering edit mode

Hello _r_am,

Thank yo so much for your comments!

Thank you again!

Best,

Yue

> ggplot2::ggsave(filename="protein.pdf", plot=pep_plot)
Saving 7 x 7 in image

> ggplot2::ggsave(filename="protein.png", plot=pep_plot)
Saving 7 x 7 in image
ADD REPLY
1
Entering edit mode

Please don't ask to be spoonfed each step. Just let us know if it worked or not.

ADD REPLY

Login before adding your answer.

Traffic: 2253 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6