png格式
data2 <- readxl::read_xlsx("C:\\Users\\zhang\\Desktop\\小白菜试验数据.xlsx",sheet="Sheet3")
str(data2)
data_2 <- data2%>%group_by(Species,Treatment)%>%filter(Treatment!=20)%>%
summarise(Root=mean(Root_lenght),Root_sd=sd(Root_lenght),
Embryo=mean(Embryo_length),Embryo_sd=sd(Embryo_length),
wet=mean(Wet_weight),wet_sd=sd(Wet_weight))
data_2$Treatment <- factor(data_2$Treatment,levels = c("CK","1.25","2.5","5","10"))
p1 <- data_2%>%ggplot()+
geom_col(aes(x=Treatment,y=Root,fill= Species),
colour = 'black',
position=position_dodge(1))+
geom_errorbar(aes(x=Treatment,ymax=Root+Root_sd,ymin=Root-Root_sd,
color=Species),width=0.3,
position=position_dodge(1))+
scale_fill_manual(values=c("grey","white"))+
scale_color_manual(values = c("black","black"))+
ylim(0,230)+
labs(x="浸提液质量浓度 (mg/mL)",y="根长 (mm)")+
theme_classic() +
theme(axis.ticks.length.y = unit(-0.15, 'cm'),
axis.text.y = element_text(margin = unit(c(0.2, 0.2, 0.2, 0.2), 'cm'))) +
theme(axis.line = element_line(arrow = arrow(length = unit(0.2, 'cm')))) +
theme(legend.title = element_blank(),
legend.position = c(0.2,0.9),
text = element_text(size=10.5, family="serif"))
ggsave("p1.png",width = 6,height = 5)
png("p1.png",width = 1200,height = 1000,units = "px")
p1
dev.off()
jpg格式
p1
ggsave("p1.jpg",width = 6,height = 5)
jpeg("p1.jpg",width = 1200,height = 1000,units = "px")
p1
dev.off()
tiff格式
p1
ggsave("p1.tiff",width = 6,height = 5)
tiff("p1.tiff",width = 1200,height = 1000,units = "px")
p1
dev.off()
bmp格式
p1
ggsave("p1.bmp",width = 6,height = 5)
bmp("p1.bmp",width = 1200,height = 1000,units = "px")
p1
dev.off()
pdf格式
p1
ggsave("p1.pdf",width = 5,height = 6,family="GB1")
pdf("p1.pdf",width = 5,height = 6,family="GB1")
p1
dev.off()
ppt格式
p1
library(eoffice)
topptx(p1,"p1.pptx")
