Mikata-Project / ggthemr

Themes for ggplot2.
893 stars 108 forks source link

ggthemr prevents ggplot from showing a plot #25

Closed spkaluzny closed 6 years ago

spkaluzny commented 6 years ago

With a theme set by ggthemr, a plot created with ggplot2 cannot be displayed (printed):

library("ggplot2")
library("ggthemr")
plt01 <- ggplot(mtcars, aes(wt, mpg)) + geom_point()
plt01  # the plot is shown
ggthemr('dust')
plt02 <- ggplot(mtcars, aes(wt, mpg)) + geom_point()
plt02 
#> Error in if (tag_pos == "manual") { : argument is of length zero

sessionInfo()
#> R version 3.4.3 (2017-11-30)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 16.04.4 LTS
#> 
#> Matrix products: default
#> BLAS: /usr/lib/atlas-base/libf77blas.so.3.0
#> LAPACK: /home/R/R-3.4.3/lib/R/lib/libRlapack.so
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] 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   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base
#> 
#> other attached packages:
#> [1] ggthemr_1.1.0      ggplot2_2.2.1.9000
#> 
#> loaded via a namespace (and not attached):
#>  [1] labeling_0.3      colorspace_1.3-2  scales_0.5.0.9000 compiler_3.4.3   
#>  [5] lazyeval_0.2.1    plyr_1.8.4        withr_2.1.2       pillar_1.2.1     
#>  [9] gtable_0.2.0      tibble_1.4.2      Rcpp_0.12.16      grid_3.4.3       
#> [13] rlang_0.2.0.9001  munsell_0.4.3
sainathadapa commented 6 years ago

I don't see an error though. I see that you are using a development version of ggplot; it is possible that the error is because of that.


R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu Bionic Beaver (development branch)

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=en_IN.UTF-8       LC_NUMERIC=C               LC_TIME=en_IN.UTF-8        LC_COLLATE=en_IN.UTF-8    
 [5] LC_MONETARY=en_IN.UTF-8    LC_MESSAGES=en_IN.UTF-8    LC_PAPER=en_IN.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_IN.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] ggthemr_1.1.0 ggplot2_2.2.1

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.16     digest_0.6.15    withr_2.1.2      plyr_1.8.4       grid_3.4.3       R6_2.2.2         gtable_0.2.0    
 [8] git2r_0.21.0     scales_0.5.0     pillar_1.2.1     httr_1.3.1       rlang_0.2.0      lazyeval_0.2.1   curl_3.2        
[15] labeling_0.3     devtools_1.13.5  tools_3.4.3      munsell_0.4.3    yaml_2.1.18      compiler_3.4.3   colorspace_1.3-2
[22] memoise_1.1.0    tibble_1.4.2 ```
spkaluzny commented 6 years ago

If I use the current CRAN version of ggplot2 (2.2.1) with ggthemr (1.1.0) the plot is correctly displayed.

version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.4 LTS

Matrix products: default
BLAS: /usr/lib/atlas-base/libf77blas.so.3.0
LAPACK: /home/R/R-3.4.3/lib/R/lib/libRlapack.so

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

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

other attached packages:
[1] ggthemr_1.1.0 ggplot2_2.2.1

loaded via a namespace (and not attached):
 [1] labeling_0.3      colorspace_1.3-2  scales_0.5.0.9000 compiler_3.4.3   
 [5] lazyeval_0.2.1    plyr_1.8.4        pillar_1.2.1      gtable_0.2.0     
 [9] tibble_1.4.2      Rcpp_0.12.16      grid_3.4.3        rlang_0.2.0.9001 
[13] munsell_0.4.3