R rayshader package plot_gg gives blank window

178 Views Asked by At

I have a problem with converting ggplots into rayshader 3d graphs. I have tested many different examples on the rayshader homepage but it just won't work. For example this code I have from the demonstration examples of the official homepage:

library(rayshader)
library(ggplot2)

mtplot = ggplot(mtcars) +
 geom_point(aes(x=mpg,y=disp,color=cyl)) +
 scale_color_continuous(limits=c(0,8))

plot_gg(mtplot, width=3.5, multicore = TRUE, windowsize = c(1400,866), sunangle=225,
       zoom = 0.60, phi = 30, theta = 45)

When I execute this code the x11 windows opens but it is blank and looks like this. when I use preview=T it works fine since the x11 windows does not open. When I close this blank window my R session is aborted and in the console it says:
pure virtual method called. I have no clue how to get rid of the problem, I could not find anything on the internet so far.

this is my session info:

R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252    LC_MONETARY=German_Germany.1252
[4] LC_NUMERIC=C                    LC_TIME=German_Germany.1252    

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

other attached packages:
[1] ggplot2_3.3.3     rayshader_0.24.11

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6              pillar_1.6.1            compiler_4.1.0          later_1.2.0            
 [5] prettyunits_1.1.1       iterators_1.0.13        tools_4.1.0             progress_1.2.2         
 [9] digest_0.6.27           tibble_3.1.2            jsonlite_1.7.2          lifecycle_1.0.0        
[13] gtable_0.3.0            pkgconfig_2.0.3         rlang_0.4.11            foreach_1.5.1          
[17] DBI_1.1.1               shiny_1.6.0             crosstalk_1.1.1         parallel_4.1.0         
[21] xfun_0.23               fastmap_1.1.0           withr_2.4.2             dplyr_1.0.6            
[25] knitr_1.33              generics_0.1.0          vctrs_0.3.8             htmlwidgets_1.5.3      
[29] hms_1.1.0               tidyselect_1.1.1        manipulateWidget_0.10.1 webshot_0.5.2          
[33] grid_4.1.0              glue_1.4.2              R6_2.5.0                fansi_0.4.2            
[37] rgl_0.106.8             purrr_0.3.4             magrittr_2.0.1          scales_1.1.1           
[41] codetools_0.2-18        promises_1.2.0.1        ellipsis_0.3.2          htmltools_0.5.1.1      
[45] assertthat_0.2.1        mime_0.10               xtable_1.8-4            colorspace_2.0-1       
[49] httpuv_1.6.1            utf8_1.2.1              miniUI_0.1.1.1          doParallel_1.0.16      
[53] munsell_0.5.0           crayon_1.4.1           
0

There are 0 best solutions below