1 theme_cowplot函数 theme_cowplot()函数的主题形式如下: p11 <- p1 + theme_cowplot() p21 <- p2 + theme_cowplot() plot_grid(p11, p21) 它的别名函数theme_half_open(),效果相同: p11 <- p1 + theme_half_open() p21 <- p2 + theme_half_open() plot_grid(p11, p21) 2 theme_minimal_gri...
scale_fill_manual(values = col.palette) + theme_cowplot(font_size = 16) + theme(axis.text.y = element_text(face = ifelse(rev(levels(df.lusc$gene_name)) %in% names(which(p.lusc < 0.05)), "bold", "plain"))) p2 ggsave('pic2.png', p2, bg = 'white', width = 5, height = ...
接着,介绍`theme_cowplot()`函数,其主题形式如下。同时,还有别名函数`theme_half_open()`,效果相同。`theme_minimal_grid()`函数与`ggplot2`中的`theme_minimal()`函数效果类似,无填充背景,只绘制主刻度网格线。使用`theme_minimal_hgrid()`函数,仅保留水平方向的主网格线。`theme_minimal_v...
require(cowplot)theme_set(theme_cowplot(font_size=12))# reduce default font sizeplot.mpg<-ggplot(mpg,aes(x=cty,y=hwy,colour=factor(cyl)))+geom_point(size=2.5)plot.diamonds<-ggplot(diamonds,aes(clarity,fill=cut))+geom_bar()+theme(axis.text.x=element_text(angle=70,vjust=0.5))plot_grid...
1. theme_bw() 示例一 2. theme_linedraw() 示例二 3. theme_classic() 示例三 4. theme_cowplot() 示例四...
虽然可以利用theme()函数获取相同的图形,但是函数background_grid()更加容易。 注意如果你既想用ggplot2的默认主题又想使用cowplot包,简单的添加theme_gray()到你的图形上或者使用theme_set(theme_gray())为所有的子图设置该主题。 plot.mpg + theme_gray() # create plot with default ggplot2 themetheme_set(...
plot_grid()提供了将图形排列进网格以及为它们添加标签的简单接口: require(cowplot) theme_set(theme_cowplot(font_size=12)) # reduce default font sizeplot.mpg <- ggplot(mpg, aes(x = cty, y = hwy, colour = factor(cyl))) + geom_point(size=2.5) plot.diamonds <- ggplot(diamonds, aes(clar...
002、清除灰色背景、背景框线、上框线、右框线 data=iris library(ggplot2) library(cowplot)## 使用cowplot包ggplot(data= data, aes(x=Petal.Length,y=Sepal.Length)) +geom_point()+ theme_cowplot()## 增加 + theme_cowplot()语句
(values=my36colors)+theme_cowplot(font_size=12)+theme(legend.position="none",panel.spacing=unit(0,"lines"),plot.title=element_text(hjust=0.5),panel.background=element_rect(fill=NA,color="black"),plot.margin=margin(7,7,0,7,"pt"),strip.background=element_blank(),strip.text=element_...
cowplot::plot_grid(p1,p2,p3,p4,p5,p6,p7,p8,ncol=4) ggthemes拓展主题 #加载包library(ggthemes) 1、theme_clean() p+theme_clean() 2、theme_calc() p+theme_calc() 3、theme_economist() p+theme_economist() 4、theme_igray() p+theme_igray() ...