sjmgarnier / viridis

Colorblind-Friendly Color Maps for R
http://sjmgarnier.github.io/viridis
Other
286 stars 38 forks source link

Using viridis with ggplot2 3.0 crashes Rstudio #59

Closed SteveBronder closed 6 years ago

SteveBronder commented 6 years ago

Since the most recent update the following code causes my Rstudio session to crash.

library(ggplot2)
library(viridis)
test_df = data.frame(xx = runif(100), groups = sample(LETTERS[1:3], 100, replace = TRUE))
ggplot(test_df, aes(y = xx, x = groups, fill = groups)) +
 geom_point() +
 scale_fill_viridis(option = "C")

Session info below

R version 3.5.0 (2018-04-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04 LTS

Matrix products: default
BLAS/LAPACK: /opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64_lin/libmkl_rt.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               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    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] viridis_0.5.1     viridisLite_0.3.0 ggplot2_3.0.0    

loaded via a namespace (and not attached):
 [1] parallelMap_1.3   Rcpp_0.12.17      pillar_1.2.3      compiler_3.5.0    plyr_1.8.4        bindr_0.1.1      
 [7] tools_3.5.0       xts_0.10-2        tibble_1.4.2      gtable_0.2.0      checkmate_1.8.5   lattice_0.20-35  
[13] pkgconfig_2.0.1   rlang_0.2.1       Matrix_1.2-14     fastmatch_1.1-0   yaml_2.1.19       parallel_3.5.0   
[19] bindrcpp_0.2.2    gridExtra_2.3     withr_2.1.2       dplyr_0.7.6       xgboost_0.71.2    grid_3.5.0       
[25] tidyselect_0.2.4  glue_1.2.0        data.table_1.11.4 R6_2.2.2          survival_2.42-4   mlr_2.12         
[31] purrr_0.2.5       magrittr_1.5      backports_1.1.2   scales_0.5.0      ParamHelpers_1.11 BBmisc_1.11      
[37] splines_3.5.0     assertthat_0.2.0  colorspace_1.3-2  stringi_1.2.3     lazyeval_0.2.1    munsell_0.5.0    
[43] zoo_1.8-2      
sjmgarnier commented 6 years ago

@SteveBronder I'm not sure what you're trying to do here, but geom_scale_fill_viridis is not a function of the viridis package. Maybe you wanted to call scale_fill_viridis instead? (though it won't do anything since you don't have a fill aesthetics)

SteveBronder commented 6 years ago

Whoops! Apologies that was a typo, dunno why that was there. I edited the code above and it still crashes Rstudio (V1.1.453)

My code above is just a mre. Adding fill to aes() also causes it to crash

sjmgarnier commented 6 years ago

@SteveBronder Can you post the corrected code please?

SteveBronder commented 6 years ago

Below is the corrected code.

library(ggplot2)
library(viridis)
test_df = data.frame(xx = runif(100), groups = sample(LETTERS[1:3], 100, replace = TRUE))
ggplot(test_df, aes(y = xx, x = groups, fill = groups)) +
 geom_point() +
 scale_fill_viridis(option = "C")

Though running this in terminal actually gives more info, this appears to be an issue with the intel MKL Intel MKL FATAL ERROR: Cannot load libmkl_core.so.

I'm pretty sure this is a 'me' issue and not a viridis issue. Feel free to close

sjmgarnier commented 6 years ago

@SteveBronder Ok. I can't reproduce it here with the version of Ubuntu, R, etc. I doubt this is caused by viridis, it doesn't have much funky code in it.

lorenzolightsgdwarf commented 1 year ago

Hi, I want to share my experience. I had the same problem with R running in a docker (rocker/shiny) on Ubuntu 22.04 but on a Proxmox VM using kvm64 as CPU. Changing the CPU type solved the problem