服务热线
178 0020 3020
作业1 > library(ggplot2) > mytheme<- theme_classic() +theme(panel.grid = element_blank(),legend.position = "no",plot.caption = element_text(face = "bold.italic"),panel.border=element_rect(fill='transparent', color='black')) >ggplot(mtcars, aes(factor(cyl))) + geom_bar(aes(fill = factor(gear)), width = 0.6) +labs(title = "title", subtitle = "subtitle", x = "cyl", fill = "gear",caption = "R02-28")+mytheme 作业2 library(ggplot2)library(latex2exp) myvolcano<-read.csv(file.choose()) myvolcano$significant <- as.factor(ifelse(-log2(myvolcano$q_value)>5,+ ifelse(abs(log2(myvolcano$FC)) >1,"yes" ,"not"),"not"))ydrop = 0.6textdrop = 1.2ggplot(myvolcano,aes(x = log2(FC) , y = -log2(q_value),size = significant))+geom_point(col = "grey70",alpha = 1)+scale_size_manual(values = c(2,0)) + geom_point(data = mysig,aes(x = log2(FC),y = -log2(q_value),color=锘縂ene.ID),size = 4) +geom_text(data = mysig,aes(label = 锘縂ene.ID),size =4,hjust=0.5,vjust =1.5,col = "black",fontface = "italic") +annotate("segment", x = 1 , xend = 2.5, y = ydrop,yend = ydrop ,color = "black",size = 1,arrow = arrow(angle = 18,ends = "last",type = "closed")) +annotate("segment", x = -1 , xend = -2.5, y = ydrop,yend = ydrop,color = "black",size = 1,arrow = arrow(angle = 18,ends = "last",type = "closed"))+annotate("text",x = 1.7,y = textdrop,label = "Upregulated",size = 4.5) +annotate("text",x = -1.7,y = textdrop,label = "Downregulated",size = 4.5) +geom_vline(xintercept = 0,linetype = 2 ,size= rel(0.8)) +xlim(-2.5,2.7) +ylim(-0.8,15) +labs(x = expression(paste(log[2],"(fold change)")),y = expression(paste(-log[2],"(Q value)")),title = "CMTM6 sgRNA2 vs Control",caption = "copy by R02-28")+theme(panel.grid = element_blank(),legend.position = "no", plot.caption = element_text(face = "bold.italic"),panel.border=element_rect(fill='transparent', color='black'))
附件