A bug about export pdf by rgl.postscript
David-R-bird opened this issue · 3 comments
Dear dmurdoch,
I met a bug when export pdf by rgl.postscript.
- rgl Version:1.1.3
- R Version:4.2.3
- Platform: Windows 10
- code:
data(iris)
x <- sep.l <- iris$Sepal.Length
y <- pet.l <- iris$Petal.Length
z <- sep.w <- iris$Sepal.Width
plot3d (x, y, z, col="blue", type ="p")
rgl.postscript("persp3da.pdf", "pdf", drawText = T)
in plot3D window it was right:
but pdf file was incorrect.
although I updated R version, it did not work.
can you give me some advice?
Thanks
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
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.
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.