## function (base_size = 11, base_family = "") ## { ## half_line <- base_size/2 ## theme(line = element_line(colour = "black", size = 0.5, linetype = 1, ## lineend = "butt"), rect = element_rect(fill = "white", ## colour = "black", size = 0.5, linetype = 1...
## base_rect_size = base_size/22) ## { ## half_line <- base_size/2 ## theme_bw(base_size = base_size, base_family = base_family, ## base_line_size = base_line_size, base_rect_size = base_rect_size) %+replace% ## theme(axis.text = element_text(colour = "black", size...
theme_bw( base_size = 10, base_family = "Arial",) 二、参数 如果要对个别地方进行详细调整,就需要用到theme()函数。首先,theme()函数中主要参数有以下这些: image.png 其次,以plot.title为例 plot.title = element_text(family="Arial",face="bold" ,color="Black",size=10,hjust=0.5,vjust=0.5, ...
theme_grey(base_size = 16, base_family = "Times") #可以一次性改变当前会话下的所有主题 theme_set(theme_bw()) #可以重置回到默认主题theme_grey() theme_set(theme_grey())
## function (base_size = 11, base_family = "") ## { ## half_line <- base_size/2 ## theme(line = element_line(colour = "black", size = 0.5, linetype = 1, ## lineend = "butt"), rect = element_rect(fill = "white", ...
## function (base_size = 11, base_family = "") ## { ## half_line <- base_size/2 ## theme(line = element_line(colour = "black", size = 0.5, linetype = 1, ## lineend = "butt"), rect = element_rect(fill = "white", ...
## function (base_size = 11, base_family = "") ## { ## half_line <- base_size/2 ## theme(line = element_line(colour = "black", size = 0.5, linetype = 1, ## lineend = "butt"), rect = element_rect(fill = "white", ...
这很容易,把ggplot2默认主题的设置函数theme_bw()的代码拿出来看看就知道了: library(ggplot2) theme_gray# 函数名不加括号,获得函数的代码 ## function (base_size = 12, base_family = "") ## { ## theme(line = element_line(colour = "black", size = 0.5, linetype = 1, ## lineend = "...
(scale)可以控制映射的属性,ggplot2中内置了很多标度;在这里我们使用ggsci包中的标度scale_color_d3...() 2.5 通过labs设置标题通过在labs()内指定title=设置主标题,x=设置x轴名,y=设置y轴名,size=和fill=分别对应了geom_point中的aes(size = drat...,fill = "Number of cylinders") + theme_bw() ...
theme_bw() theme_linedraw() theme_light() theme_dark() theme_minimal() theme_void() theme_test() #常用于学术期刊 theme_classic()#常用于学术期刊 1. 2. 3. 4. 5. 6. 7. 8. 9. 使用如下 library(ggplot2) p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg)) ...