服务热线
178 0020 3020
ggplot画散点图,用max和min将坐标的最大值和最小值取出,用ceiling函数向上取整
library(ggplot2) mydata<- read.csv("E:/data/R2-1-1.csv",header=TRUE) xmax <- ceiling(max(mydata$A)) xmin <- ceiling(min(mydata$A))-1 ymax <- ceiling(max(mydata$B)) ymin <- ceiling(min(mydata$B))-1 ggplot(mydata,aes(A,B))+ geom_point(aes(color=SIZE),size=2,shape=1)+ ggtitle("R2-02")+ xlab("A gene expressiom")+ ylab("B gene expressiom")+ xlim(xmin,xmax)+ ylim(ymin,ymax) #或者以下的代码 ggplot(mydata,aes(x=A,y=B,color=SIZE))+ geom_point(size=2,shape=1)+ labs(xlib="A gene expression",ylib="B gene expression",title="R2-02")
mydata<- read.csv("E:/data/R2-1-2.csv",header=TRUE) ggplot(mydata,aes(Time,value,color=SIZE,shape=SIZE))+ geom_line(color="blue")+ geom_point(size=3)+ ggtitle("R2-02")+ xlab("Time")+ ylab("value")
附件