1. theme_bw()
kk <- as.data.frame(list(aa=rnorm(1000), bb=rnorm(1000)))
plot_1 <- ggplot()+geom_point(data = kk, aes(x=aa, y=bb), stat = "identity", position = "dodge")+
ggtitle("默认")+theme(plot.title = element_text(hjust = 0.5, size = 25, color="red"))
plot_2 <- ggplot()+geom_point(data = kk, aes(x=aa, y=bb), stat = "identity", position = "dodge")+theme_bw()+
ggtitle("theme_bw()")+theme(plot.title = element_text(hjust = 0.5, size=25, color="red"))
plot_grid(plot_1, plot_2) '#示例一
2. theme_linedraw()
kk <- as.data.frame(list(aa=rnorm(1000), bb=rnorm(1000)))
plot_1 <- ggplot()+geom_point(data = kk, aes(x=aa, y=bb), stat = "identity", position = "dodge")+
ggtitle("默认")+theme(plot.title = element_text(hjust = 0.5, size = 25, color="red"))
plot_2 <- ggplot()+geom_point(data = kk, aes(x=aa, y=bb), stat = "identity", position = "dodge")+theme_linedraw()+
ggtitle("theme_linedraw()")+theme(plot.title = element_text(hjust = 0.5, size=25, color="red"))
plot_grid(plot_1, plot_2) '#示例二
3. theme_classic()
kk <- as.data.frame(list(aa=rnorm(1000), bb=rnorm(1000)))
plot_1 <- ggplot()+geom_point(data = kk, aes(x=aa, y=bb), stat = "identity", position = "dodge")+
ggtitle("默认")+theme(plot.title = element_text(hjust = 0.5, size = 25, color="red"))
plot_2 <- ggplot()+geom_point(data = kk, aes(x=aa, y=bb), stat = "identity", position = "dodge")+theme_classic()+
ggtitle("theme_classic()")+theme(plot.title = element_text(hjust = 0.5, size=25, color="red"))
plot_grid(plot_1, plot_2) '#示例三
4. theme_cowplot()
kk <- as.data.frame(list(aa=rnorm(1000), bb=rnorm(1000)))
plot_1 <- ggplot()+geom_point(data = kk, aes(x=aa, y=bb), stat = "identity", position = "dodge")+
ggtitle("默认")+theme(plot.title = element_text(hjust = 0.5, size = 25, color="red"))
plot_2 <- ggplot()+geom_point(data = kk, aes(x=aa, y=bb), stat = "identity", position = "dodge")+theme_cowplot()+
ggtitle("theme_cowplot()")+theme(plot.title = element_text(hjust = 0.5, size=25, color="red"))
plot_grid(plot_1, plot_2) '#示例四
5. theme_light()
kk <- as.data.frame(list(aa=rnorm(1000), bb=rnorm(1000)))
plot_1 <- ggplot()+geom_point(data = kk, aes(x=aa, y=bb), stat = "identity", position = "dodge")+
ggtitle("默认")+theme(plot.title = element_text(hjust = 0.5, size = 25, color="red"))
plot_2 <- ggplot()+geom_point(data = kk, aes(x=aa, y=bb), stat = "identity", position = "dodge")+theme_light()+
ggtitle("theme_light()")+theme(plot.title = element_text(hjust = 0.5, size=25, color="red"))
plot_grid(plot_1, plot_2) '#示例五