Detailed description |
I used rgl.postscript to export an pdf of the example coe of legend3d, but the legends don't show in the pdf:
> library(rgl)
> x <- rnorm(100)
> y <- rnorm(100)
> z <- rnorm(100)
> open3d()
> # Needs to be a bigger window than the default
> par3d(windowRect = c(100, 100, 612, 612))
> Sys.sleep(0.1) # Allow sluggish window managers to catch up
> parent <- currentSubscene3d()
> mfrow3d(2, 2)
> plot3d(x, y, z)
> next3d(reuse = FALSE)
> bgplot3d(plot(y, z))
> next3d(reuse = FALSE)
> bgplot3d(plot(x, z))
> next3d(reuse = FALSE)
> legend3d("center", c("2D Points", "3D Points"), pch = c(1, 16))
> useSubscene3d(parent)
> rgl.postscript("rgl-test.pdf", fmt="pdf")
This produces the first attached image.
The legens show when snapshotting to png:
> rgl.snapshot("rgl-test.png", fmt="png")
This produces the second attached image.
--------------------------------
Package: rgl
Version: 0.98.1
Built: R 3.2.2; x86_64-apple-darwin13.4.0; 2017-03-16 09:42:08 UTC; unix
My sessionInfo():
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.6 (El Capitan)
locale:
[1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rgl_0.98.1 rJava_0.9-8
loaded via a namespace (and not attached):
[1] Rcpp_0.12.10 digest_0.6.12 mime_0.5 grid_3.2.2 plyr_1.8.4
[6] R6_2.1.2 xtable_1.8-2 jsonlite_1.3 gtable_0.2.0 magrittr_1.5
[11] scales_0.4.0 ggplot2_2.1.0 tools_3.2.2 htmlwidgets_0.8 munsell_0.4.3
[16] shiny_1.0.0 httpuv_1.3.3 colorspace_1.2-6 htmltools_0.3.5 knitr_1.15.1
|
|