Попытка переключить тему на theme_bw()
не работает, theme_grey()
кажется приоритетным. Любые идеи почему?ggtern отключает некоторые темы от ggplot2
ggplot(data=mpg,aes(y=year,x=cyl)) + geom_point() + theme_bw()
EDIT:
Как указывается в комментариях, это работает при запуске в чистой R сессии. Но когда я реализую код в сеансе с загруженным ggtern
, проблема возникает.
library(ggplot2)
#Warning message:
#package ‘ggplot2’ was built under R version 3.2.5
ggplot(data=mpg,aes(y=year,x=cyl)) + geom_point() + theme_bw()
# sessionInfo()
# R version 3.2.2 (2015-08-14)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows 8 x64 (build 9200)
#
# locale:
# [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
# [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
# [5] LC_TIME=English_United States.1252
#
# attached base packages:
# [1] stats graphics grDevices utils datasets methods base
#
# other attached packages:
# [1] ggplot2_2.1.0
#
# loaded via a namespace (and not attached):
# [1] labeling_0.3 colorspace_1.2-6 scales_0.4.0 plyr_1.8.3 tools_3.2.2 gtable_0.1.2
# [7] Rcpp_0.12.2 grid_3.2.2 munsell_0.4.2
library(ggtern)
#Loading required package: ggplot2
#Attaching package: ‘ggtern’
#The following objects are masked from ‘package:ggplot2’:
#aes, calc_element, ggplot, ggplot_build, ggplot_gtable, ggplotGrob, ggsave, is.ggplot, layer_data,
#layer_grob, layer_scales, theme, theme_bw, theme_classic, theme_dark, theme_get, theme_gray,
#theme_light, theme_linedraw, theme_minimal, theme_set, theme_void
#Warning messages:
#1: package ‘ggtern’ was built under R version 3.2.5
#2: package ‘ggplot2’ was built under R version 3.2.5
ggplot(data=mpg,aes(y=year,x=cyl)) + geom_point() + theme_bw()
# sessionInfo()
# R version 3.2.2 (2015-08-14)
# Platform: x86_64-w64-mingw32/x64 (64-bit)
# Running under: Windows 8 x64 (build 9200)
#
# locale:
# [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
# [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
# [5] LC_TIME=English_United States.1252
#
# attached base packages:
# [1] stats graphics grDevices utils datasets methods base
#
# other attached packages:
# [1] ggtern_2.1.1 ggplot2_2.1.0
#
# loaded via a namespace (and not attached):
# [1] Rcpp_0.12.2 lattice_0.20-33 MASS_7.3-45 grid_3.2.2 plyr_1.8.3
# [6] bayesm_3.0-2 gtable_0.1.2 magrittr_1.5 scales_0.4.0 stringi_1.0-1
# [11] compositions_1.40-1 robustbase_0.92-5 latex2exp_0.4.0 boot_1.3-17 labeling_0.3
# [16] proto_0.3-10 tools_3.2.2 stringr_1.0.0 energy_1.6.2 DEoptimR_1.0-4
# [21] munsell_0.4.2 colorspace_1.2-6 tensorA_0.36 gridExtra_2.0.0
Похоже ggtern маски много тем из ggplot2.
Я не могу воспроизвести это поведение. Возможно, вы захотите попробовать еще раз на чистом сеансе, и если он по-прежнему сохраняется, разделите свои версии R и ggplot2 и платформу, на которой вы находитесь. – joran
Это должно сработать. Предоставьте свой sessionInfo(). – Roland
Это похоже на привязку к ggtern. –