plot.margin=unit(c(0,0,0,0),"cm")) -> china.ocean china.ocean 4.4 拼接中国大陆主体地图和南海小地图 ggdraw() + draw_plot(china.main) + draw_plot(china.ocean,x = .8, y = .03, width = .12, height = .20) -> total.china total.china 5. 绘制渭河流域底图 5.1 读取渭河流域高程...
ggdraw()+draw_plot(A)+draw_plot(B,scale=0.22,x=0.35,y=0.3)+draw_plot_label(label=c('A','B'),x=c(0.01,0.75),y=c(1,0.95)) 4、draw_figure_label 和draw_plot_label功能完全类似,并且可以直接draw_plot_label中的参数。值得一提的是position,可以等于top.left、top、top.right、bottom.left...
p1 <- ggdraw() + draw_image(logo_file) logo_file <- system.file("extdata", "logo.png", package = "cowplot") p2 <- ggdraw() + draw_plot(p0) + draw_image(logo_file, scale = .5,x = .3,y = 0) p3 <- ggdraw(ggplot(mpg, aes(as.factor(year), hwy)) + geom_boxplot()...
可自定义图片在画布中的长宽比 library("cowplot")ggdraw()+draw_plot(p,x=0,y=.5,width=.5,height=.5)+draw_plot(q,x=.5,y=.5,width=.5,height=.5)+draw_plot(r,x=0,y=0,width=1,height=0.5)+draw_plot_label(label=c("A","B","C"),size=15,x=c(0,0.5,0),y=c(1,1,0.5)...
ggdraw( xlim = c(0, 1.1), ylim = c(0, 0.30))+ draw_plot(aligned_plots[[1]], x=0,y=0, width=0.5, height = 0.28)+ draw_plot(aligned_plots[[2]], x=0.50,y=0, width = 0.5, height = 0.28) image.png 示例数据和代码可以在公众号后台留言20220608获取 ...
drawRect=TRUE) 1. 2. 3. 4. 实例 代码: eg5.2 library(vioplot) x1 <- mtcars$mpg[mtcars$cyl==4] x2 <- mtcars$mpg[mtcars$cyl==6] x3 <- mtcars$mpg[mtcars$cyl==8] vioplot(x1,x2,x3,names= c("4 cyl","6 cyl","8 cyl"),col = "gold") ...
ggdraw( xlim = c(0, 1.1), ylim = c(0, 0.30))+ draw_plot(aligned_plots[[1]], x=0,y=0, width=0.5, height = 0.28)+ draw_plot(aligned_plots[[2]], x=0.50,y=0, width = 0.5, height = 0.28) 1. 2. 3. 4. 5.
theme(axis.text.x =element_text(face="bold", size=8))+ theme(axis.text.y =element_text(face="bold", size=8)) p4 <-ggdraw(p3) +draw_plot(p2,0.3,0.25,0.5,0.7) ggarrange(p1,p4,ncol=1,nrow=2,labels=c("A","B"))
data=read.table("ribbon_plot.txt",header=T,sep="\t")#draw the ribbonggplot(data,aes(Year,Anomaly10y))+geom_ribbon(aes(ymin=Anomaly10y-Unc10y,ymax=Anomaly10y+Unc10y),alpha=.2)+geom_line() 代码语言:javascript 复制 #change the visualization,using lines insteadofribbonggplot(data,aes(Year,...
plot函数是R语言最基础的函数之一,参数较多,难以记住所有的参数详细用法,这里总结一下,以便查阅。 * x,y分别是横坐标和纵坐标。 x<-1:10 y<-x plot(x,y) * 参数main指定标题(图上方),sub指定副标题(图下方), xlab与ylab(lable标签)分别指定x,y轴的标签。