dmurdoch / rgl

rgl is a 3D visualization system based on OpenGL. It provides a medium to high level interface for use in R, currently modelled on classic R graphics, with extensions to allow for interaction.
https://dmurdoch.github.io/rgl/
GNU General Public License v2.0
85 stars 20 forks source link

A bug about export pdf by rgl.postscript #346

Closed David-R-bird closed 1 year ago

David-R-bird commented 1 year ago

Dear dmurdoch, I met a bug when export pdf by rgl.postscript.

in plot3D window it was right: 11

but pdf file was incorrect.

$BFX{PD}S%%(@LS%U$~OOI3

although I updated R version, it did not work. can you give me some advice?

Thanks

David-R-bird commented 1 year ago

This is R in

sessionInfo() R version 4.2.3 (2023-03-15 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale: [1] LC_COLLATE=Chinese (Simplified)_China.utf8 LC_CTYPE=Chinese (Simplified)_China.utf8 LC_MONETARY=Chinese (Simplified)_China.utf8 [4] LC_NUMERIC=C LC_TIME=Chinese (Simplified)_China.utf8

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

other attached packages: [1] rgl_1.1.3

loaded via a namespace (and not attached): [1] htmlwidgets_1.6.2 compiler_4.2.3 magrittr_2.0.3 fastmap_1.1.1 R6_2.5.1 cli_3.6.1 htmltools_0.5.5
[8] tools_4.2.3 base64enc_0.1-3 knitr_1.42 xfun_0.38 jsonlite_1.8.4 digest_0.6.31 rlang_1.1.0

dmurdoch commented 1 year ago

rgl.postscript has never worked very well, as its help page says. It relies on the gl2ps library, currently using version 1.4.0 of that library. Following the link in the referenced web page, I see that 1.4.2 is now available. I'll leave this issue open until 1.4.2 is incorporated into rgl, but looking at the gl2ps history, I don't think it will do any better.

So my advice would be to find a different way to include figures rather than attempting to use rgl.postscript. You can get reasonable quality from snapshot3d if you ask for a very large window and then shrink it in your document.

David-R-bird commented 1 year ago

Thank you for your advice, but snapshot3d limited figure quality. I have no choice but run rgl.postscript in another computer and it produced right pdf.