R语言pdf png画图
pdf("histograms of gene expression in flower tissues-2.pdf ", width=14, height=14=
par(mfrow=c(6,3), mar=c(3,3,3,3), cex=1, bg="lightgray", f g=”red")
for (i in 1:17) {
y <- log2(flower[,i])
hist(y, xlim=c(-10,15), main=colnames(flower)[i], col="ye llow")
box()
}
dev.off()
>example<- read.csv("phenotype.csv",header=TRUE,sep=",",r https://www.360docs.net/doc/57426225.html,s = 1)
>library(gridExtra)
>library(ggplot2)
>jpeg("Plot1.jpeg", width = 6, height = 4, units = 'in', re s = 600)
>p <- ggplot(example, aes(x=Genotype, color=Genotype))
>p = p + geom_boxplot(aes(y=Leaf.No.),fill="grey", notch=T RUE)
>p = p + theme_bw() + theme(axis.line = element_line(colou r = "black"),
+ panel.grid.major = element_blank(), panel.grid.minor = e lement_blank(),
+ panel.border = element_rect(color="black", size=1.2), pa nel.background = element_blank())
>p = p + scale_color_manual(values=c('red', 'blue'))
>p
notch went outside hinges. Try setting notch=FALSE.
>a<- ggplot(example, aes(x=Genotype, color=Genotype))
>a = a + geom_boxplot(aes(y=Flowering.Time),fill="grey", n otch=TRUE)
>a = a + theme_bw() + theme(axis.line = element_line(colou r = "black"),
+ panel.grid.major = element_blank(), panel.grid.minor = e lement_blank(),
+ panel.border = element_rect(color="black", size=1.2), pa nel.background = element_blank())
>a = a + scale_color_manual(values=c('magenta', 'green')) >a
notch went outside hinges. Try setting notch=FALSE.
>grid.arrange(p,a,nrow=1, ncol=2)
notch went outside hinges. Try setting notch=FALSE.
notch went outside hinges. Try setting notch=FALSE.
>dev.off()
RStudioGD
2