Mikata-Project / ggthemr

Themes for ggplot2.
886 stars 107 forks source link

Warning: Missing Elements #12

Closed alexilliamson closed 7 years ago

alexilliamson commented 7 years ago

Everytime I load a theme with gthemr() it warns as below:

panel.margin is deprecated. Please use panel.spacing property insteadlegend.margin must be specified using margin(). For the old behavior use legend.spacingNew theme missing the following elements: axis.title.x.top, axis.title.y.right, axis.text.x.top, axis.text.y.right, legend.spacing.x, legend.spacing.y, legend.box.margin, legend.box.background, legend.box.spacing, panel.spacing.x, panel.spacing.y, plot.subtitle, plot.caption, strip.placement.

Can these missing elements be defaulted so that this warning stops appearing?

sainathadapa commented 7 years ago

Can you give a reproducible example along with output from sessionInfo()

alexilliamson commented 7 years ago

My apologies, I'm pretty new to this. Below is the example that produces the warning described in my first comment. sessionInfo() is also included. Thanks immensely!

> library(ggplot2)
> library(ggthemr)
> ggthemr("pale", spacing = 2)
Warning messages:
1: `panel.margin` is deprecated. Please use `panel.spacing` property instead 
2: `legend.margin` must be specified using `margin()`. For the old behavior use legend.spacing 
3: New theme missing the following elements: axis.title.x.top, axis.title.y.right, axis.text.x.top, axis.text.y.right, legend.spacing.x, legend.spacing.y, legend.box.margin, legend.box.background, legend.box.spacing, panel.spacing.x, panel.spacing.y, plot.subtitle, plot.caption, strip.placement 
> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

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

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

other attached packages:
[1] ggthemr_1.0.2      ggplot2_2.1.0.9001

loaded via a namespace (and not attached):
 [1] colorspace_1.2-7  scales_0.4.0.9003 lazyeval_0.2.0    plyr_1.8.4        assertthat_0.1    tools_3.3.0       gtable_0.2.0     
 [8] tibble_1.2        Rcpp_0.12.7       grid_3.3.0        munsell_0.4.3    
sainathadapa commented 7 years ago

I don't see any issues on my side. You are using a older version of ggplot2. Can you upgrade it to the latest stable version, 2.2.1 and check? Here is my sessionInfo():

> library(ggplot2)
> library(ggthemr)
> ggthemr("pale", spacing = 2)
> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

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

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

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

loaded via a namespace (and not attached):
 [1] colorspace_1.3-2 scales_0.4.1     assertthat_0.1   lazyeval_0.2.0   plyr_1.8.4       tools_3.3.2      gtable_0.2.0     tibble_1.2      
 [9] Rcpp_0.12.9      grid_3.3.2       munsell_0.4.3   
alexilliamson commented 7 years ago

I updated ggplot2 and I am still seeing that same warning:

> library(ggplot2)

> library(ggthemr)

> ggthemr("pale", spacing = 2)

> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

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

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

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

loaded via a namespace (and not attached):
 [1] colorspace_1.2-7 scales_0.4.1     assertthat_0.1   lazyeval_0.2.0   plyr_1.8.4       tools_3.3.0      gtable_0.2.0     tibble_1.2      
 [9] Rcpp_0.12.7      grid_3.3.0       munsell_0.4.3   
Warning messages:
1: R graphics engine version 11 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed. 
2: package ‘ggplot2’ was built under R version 3.3.2 
3: `panel.margin` is deprecated. Please use `panel.spacing` property instead 
4: `legend.margin` must be specified using `margin()`. For the old behavior use legend.spacing 
5: New theme missing the following elements: axis.title.x.top, axis.title.y.right, axis.text.x.top, axis.text.y.right, legend.spacing.x, legend.spacing.y, legend.box.margin, legend.box.background, legend.box.spacing, panel.spacing.x, panel.spacing.y, plot.subtitle, plot.caption, strip.placement
sainathadapa commented 7 years ago

Can you re-install the ggthemr? You may have an older version. Also, seems like you need to upgrade RStudio as well.

alexilliamson commented 7 years ago

I re-installed ggthemr and the warning went away. Waiting for admin approval at work to update RStudio :-/.

Thanks for your help!