我想创建一个ggplot基于的新主题theme_bw().
我想以下步骤是必要的(在伪代码中):
theme_new() <- theme_bw()theme_update(axis.title.x = theme_text(family = base_family, size = base_size, vjust = 0.5))任何关于如何实现这一点的建议将非常感谢!
编辑: @Andrie,我根据自己的需要修改了你的答案:
theme_new <- theme_set(theme_bw())
theme_new <- theme_update(axis.title.x = theme_text(family = base_family, size = base_size, vjust = 0.5))
Run Code Online (Sandbox Code Playgroud)
但是,我收到以下错误:
ggplot(mtcars, aes(factor(cyl))) + geom_bar()
Run Code Online (Sandbox Code Playgroud)
匹配错误(gparname,names(gpars)):找不到对象'base_size'
编辑: 2017年10月31日,由@Andrie提供的答案工作得很好. R版本3.4.1,ggplot2_2.2.1